CMlib
Cell mapping algorithms in C++
vec2 Class Reference

Very simple 2-element vector class. More...

#include <vec2.h>

Public Member Functions

 vec2 ()
 Container of components. More...
 
 vec2 (std::initializer_list< double > l)
 Constructor with initializer_lists. More...
 
double & operator[] (unsigned int i)
 Operator[] for accessing the i-th component (mutable) More...
 
const double & operator[] (unsigned int i) const
 Operator[] for accessing the i-th component (const) More...
 

Detailed Description

Very simple 2-element vector class.

Constructor & Destructor Documentation

◆ vec2() [1/2]

vec2::vec2 ( )

Container of components.

Default constructor, fills the vector with zeros

◆ vec2() [2/2]

vec2::vec2 ( std::initializer_list< double >  l)

Constructor with initializer_lists.

Example: vec2 v = {0, 1}

Member Function Documentation

◆ operator[]() [1/2]

double & vec2::operator[] ( unsigned int  i)

Operator[] for accessing the i-th component (mutable)

◆ operator[]() [2/2]

const double & vec2::operator[] ( unsigned int  i) const

Operator[] for accessing the i-th component (const)


The documentation for this class was generated from the following files: