24 #ifndef CPPR_OPERATORS_H //make sure this only gets included once
25 #define CPPR_OPERATORS_H
32 template <
typename T >
33 ublas::matrix<T>
operator/(
const T &value, ublas::matrix<T> &m1)
35 ublas::matrix<T> ret(m1.size1(), m1.size2());
36 for(
unsigned int row=0;row<m1.size1();row++)
38 for(
unsigned int col=0;col<m1.size2();col++)
40 ret(row,col) = value / m1(row,col);
48 template <
typename T >
49 ublas::vector<T>
operator/(
const T &value, ublas::vector<T> &v1)
51 ublas::vector<T> ret(v1.size());
52 for(
unsigned int row=0;row<v1.size();row++)
54 ret[row] = value / v1[row];