ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Functions
tiny_vec.hpp File Reference

(Last Changed on August 16, 2017 for git-revision a35d913b7bcb1e88372cebad05e8aaf70f6d0ad8.)

Go to the source code of this file.

Classes

struct  tiny_vec< Type, n >
 
struct  tiny_vec_ref< Type >
 

Macros

#define COMPOUND_ASSIGNMENT_OPERATOR(OP)
 
#define VBINARY_OPERATOR(OP)
 
#define VUNARY_OPERATOR(OP)
 

Functions

template<class Type , int n>
tiny_vec< Type, n > operator* (const Type &x, const tiny_vec< Type, n > &y)
 
template<class Type , int n>
std::ostream & operator<< (std::ostream &os, tiny_vec< Type, n > const &x)
 

Macro Definition Documentation

#define COMPOUND_ASSIGNMENT_OPERATOR (   OP)
Value:
tiny_vec& operator OP (const Type &other) { \
for(int i=0; i<n; i++) (*this).data[i] OP other; \
return *this; \
} \
tiny_vec& operator OP (const tiny_vec &other) { \
for(int i=0; i<n; i++) (*this).data[i] OP other[i]; \
return *this; \
}
Type data[n]
Definition: tiny_vec.hpp:18

Definition at line 59 of file tiny_vec.hpp.

#define VBINARY_OPERATOR (   OP)
Value:
tiny_vec operator OP (const tiny_vec &other) const { \
tiny_vec ans; \
for(int i=0; i<n; i++) ans.data[i] = data[i] OP other.data[i]; \
return ans; \
} \
template<class Scalar> \
tiny_vec operator OP (const Scalar &other) const { \
tiny_vec ans; \
for(int i=0; i<n; i++) ans.data[i] = data[i] OP other; \
return ans; \
}
Type data[n]
Definition: tiny_vec.hpp:18

Definition at line 35 of file tiny_vec.hpp.

#define VUNARY_OPERATOR (   OP)
Value:
tiny_vec operator OP () const { \
tiny_vec ans; \
for(int i=0; i<n; i++) ans.data[i] = OP (*this).data[i]; \
return ans; \
}
Type data[n]
Definition: tiny_vec.hpp:18

Definition at line 51 of file tiny_vec.hpp.

Function Documentation

template<class Type , int n>
tiny_vec<Type, n> operator* ( const Type &  x,
const tiny_vec< Type, n > &  y 
)

Definition at line 83 of file tiny_vec.hpp.

template<class Type , int n>
std::ostream& operator<< ( std::ostream &  os,
tiny_vec< Type, n > const &  x 
)

Definition at line 88 of file tiny_vec.hpp.