MechSys  1.0
Computing library for simulations in continuum and discrete mechanics
Classes | Namespaces | Defines | Functions
/home/dorival/mechsys/lib/linalg/laexpr.h File Reference
#include <iostream>
#include <sstream>
#include <mechsys/linalg/matrix.h>
#include <mechsys/linalg/vector.h>
#include <mechsys/util/fatal.h>

Go to the source code of this file.

Classes

class  LinAlg::expression< t_exp, t_res >
class  LinAlg::exp_un< t_exp1, t_op, t_res >
class  LinAlg::exp_bin< t_exp1, t_exp2, t_op, t_res >
class  LinAlg::exp_ter< t_exp1, t_exp2, t_exp3, t_op, t_res >
struct  LinAlg::res_type< t_exp, t_exp_again >
struct  LinAlg::res_type< t_exp, exp_un< typename t_exp::T_exp1, typename t_exp::T_op, typename t_exp::T_res > >
struct  LinAlg::res_type< t_exp, exp_bin< typename t_exp::T_exp1, typename t_exp::T_exp2, typename t_exp::T_op, typename t_exp::T_res > >
class  LinAlg::op_add
class  LinAlg::op_minus
class  LinAlg::op_minus_un
class  LinAlg::op_prod
class  LinAlg::op_prod_sc
class  LinAlg::op_div_sc
class  LinAlg::op_trn
class  LinAlg::op_oto
class  LinAlg::op_oot
class  LinAlg::op_otot

Namespaces

namespace  LinAlg
 

Linear algebra routines.


Defines

#define DECLARE_OP_WITH_SCALAR(MACRO)
#define EXPR_MULT_SCALAR(T)
#define EXPR_DIV_SCALAR(T)
#define VECTOR_MULT_SCALAR(T)
#define VECTOR_DIV_SCALAR(T)
#define MATRIX_MULT_SCALAR(T)
#define MATRIX_DIV_SCALAR(T)

Functions

double ddot_ (int const *N, double const *X, int const *incX, double const *Y, int const *incY)
void dgemv_ (char const *TransA, int const *M, int const *N, double const *alpha, double const *A, int const *lda, double const *X, int const *incX, double const *beta, double *Y, int const *incY)
void dgemm_ (char const *TransA, char const *TransB, int const *M, int const *N, int const *K, double const *alpha, double const *A, int const *lda, double const *B, int const *ldb, double const *beta, double *C, int const *ldc)
double LinAlg::Dot (Vector< double > const &X, Vector< double > const &Y)
 internal product: $ s \gets \{X\} \bullet \{Y\} $
void LinAlg::Gemv (double const a, Matrix< double > const &A, Vector< double > const &X, double const b, Vector< double > &Y)
 GEneral matrix * vector: $ \{Y\} \gets \alpha[A]\{X\} + \beta\{Y\} $.
void LinAlg::Gemm (double const a, Matrix< double > const &A, Matrix< double > const &B, double const b, Matrix< double > &C)
 GEneral matrix x matrix: $ [C] \gets \alpha[A][B] + \beta[C] $.
void LinAlg::Gemtm (double const a, Matrix< double > const &A, Matrix< double > const &B, double const b, Matrix< double > &C)
 GEneral matrix^T x matrix: $ [C] \gets \alpha[A]^T[B] + \beta[C] $.
void LinAlg::Gemmt (double const a, Matrix< double > const &A, Matrix< double > const &B, double const b, Matrix< double > &C)
 GEneral matrix x matrix^T: $ [C] \gets \alpha[A][B]^T+ \beta[C] $.
void LinAlg::Gemtmt (double const a, Matrix< double > const &A, Matrix< double > const &B, double const b, Matrix< double > &C)
 GEneral matrix^T x matrix^T: $ [C] \gets \alpha[A]^T[B]^T + \beta[C] $.
template<typename type >
void LinAlg::_scale (size_t n, type a, type const *ptrX, type *ptrY)
template<typename type >
void LinAlg::_scale (size_t n, type a, type const *ptrX, type b, type const *ptrW, type *ptrY)
template<typename type >
void LinAlg::scale (type a, Vector< type > const &X, Vector< type > &Y)
template<typename type >
void LinAlg::scale (type a, Vector< type > const &X, type b, Vector< type > const &W, Vector< type > &Y)
template<typename type >
void LinAlg::scale (type a, Matrix< type > const &X, Matrix< type > &Y)
template<typename type >
void LinAlg::scale (type a, Matrix< type > const &X, type b, Matrix< type > const &W, Matrix< type > &Y)
template<typename type >
void LinAlg::scalet (type a, Vector< type > const &A, Matrix< type > &B)
template<typename type >
void LinAlg::scalet (type a, Matrix< type > const &A, Matrix< type > &B)
template<typename type >
Vector< type > & LinAlg::_add (Vector< type > const &A, Vector< type > const &B, Vector< type > &R)
template<typename type >
Vector< type > & LinAlg::_minus (Vector< type > const &A, Vector< type > const &B, Vector< type > &R)
template<class type , class t_num1 >
Vector< type > & LinAlg::_prod (t_num1 const &a, Vector< type > const &A, Vector< type > &R)
template<typename type >
Matrix< type > & LinAlg::_trn (Vector< type > const &A, Matrix< type > &R)
template<typename type >
Matrix< type > & LinAlg::_add (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<typename type >
Matrix< type > & LinAlg::_minus (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class type >
Vector< type > & LinAlg::_prod (Matrix< type > const &A, Vector< type > const &B, Vector< type > &R)
template<class type >
Matrix< type > & LinAlg::_prod (Vector< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class type >
Matrix< type > & LinAlg::_prod (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class type , class t_scalar >
Matrix< type > & LinAlg::_prod (t_scalar const &A, Matrix< type > const &B, Matrix< type > &R)
template<typename type >
Matrix< type > & LinAlg::_trn (Matrix< type > const &A, Matrix< type > &R)
template<class type >
Matrix< type > & LinAlg::_prodt (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class type >
Matrix< type > & LinAlg::_prod_t (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class type >
Matrix< type > & LinAlg::_prod_t (Vector< type > const &A, Vector< type > const &B, Matrix< type > &R)
template<class type >
type & LinAlg::_prodt (Vector< type > const &A, Vector< type > const &B, type &R)
template<class type >
Matrix< type > & LinAlg::_prodtt (Matrix< type > const &A, Matrix< type > const &B, Matrix< type > &R)
template<class t_exp , class t_res >
std::ostream & LinAlg::operator<< (std::ostream &os, expression< t_exp, t_res > const &expr)
template<class t_exp , class t_res >
exp_un< t_exp, op_minus_un, t_res > LinAlg::operator- (expression< t_exp, t_res > const &A)
template<class t_exp , class t_res >
expression< t_exp, t_res > LinAlg::operator+ (expression< t_exp, t_res > const &A)
template<class t_obj , class t_exp1 >
exp_bin< t_exp1, t_obj, op_add,
t_obj > 
LinAlg::operator+ (expression< t_exp1, t_obj > const &A, t_obj const &B)
template<class t_obj , class t_exp1 >
exp_bin< t_obj, t_exp1, op_add,
t_obj > 
LinAlg::operator+ (t_obj const &A, expression< t_exp1, t_obj > const &B)
template<class t_obj , class t_exp1 , class t_exp2 >
exp_bin< t_exp1, t_exp2,
op_add, t_obj > 
LinAlg::operator+ (expression< t_exp1, t_obj > const &A, expression< t_exp2, t_obj > const &B)
template<class t_obj , class t_exp1 , class t_exp2 >
exp_bin< t_exp1, t_exp2,
op_minus, t_obj > 
LinAlg::operator- (expression< t_exp1, t_obj > const &A, expression< t_exp2, t_obj > const &B)
template<class t_obj , class t_exp1 >
exp_bin< t_exp1, t_obj,
op_minus, t_obj > 
LinAlg::operator- (expression< t_exp1, t_obj > const &A, t_obj const &B)
template<class t_obj , class t_exp1 >
exp_bin< t_obj, t_exp1,
op_minus, t_obj > 
LinAlg::operator- (t_obj const &A, expression< t_exp1, t_obj > const &B)
 LinAlg::DECLARE_OP_WITH_SCALAR (EXPR_MULT_SCALAR)
 LinAlg::DECLARE_OP_WITH_SCALAR (EXPR_DIV_SCALAR)
template<class type >
exp_un< Vector< type >
, op_minus_un, Vector< type > > 
LinAlg::operator- (Vector< type > const &A)
template<class type >
Vector< type > LinAlg::operator+ (Vector< type > const &A)
template<typename type >
exp_bin< Vector< type >
, Vector< type >, op_add,
Vector< type > > 
LinAlg::operator+ (Vector< type > const &A, Vector< type > const &B)
template<typename type >
exp_bin< Vector< type >
, Vector< type >, op_minus,
Vector< type > > 
LinAlg::operator- (Vector< type > const &A, Vector< type > const &B)
template<typename type >
exp_un< Vector< type >, op_trn,
Matrix< type > > 
LinAlg::trn (Vector< type > const &A)
template<class type , class t_exp1 >
exp_un< t_exp1, op_trn, Matrix
< type > > 
LinAlg::trn (expression< t_exp1, Vector< type > > const &A)
 LinAlg::DECLARE_OP_WITH_SCALAR (VECTOR_MULT_SCALAR)
 LinAlg::DECLARE_OP_WITH_SCALAR (VECTOR_DIV_SCALAR)
template<class type >
exp_un< Matrix< type >
, op_minus_un, Matrix< type > > 
LinAlg::operator- (Matrix< type > const &A)
template<class type >
Matrix< type > LinAlg::operator+ (Matrix< type > const &A)
template<typename type >
exp_bin< Matrix< type >
, Matrix< type >, op_add,
Matrix< type > > 
LinAlg::operator+ (Matrix< type > const &A, Matrix< type > const &B)
template<typename type >
exp_bin< Matrix< type >
, Matrix< type >, op_minus,
Matrix< type > > 
LinAlg::operator- (Matrix< type > const &A, Matrix< type > const &B)
template<typename type >
exp_bin< Matrix< type >
, Matrix< type >, op_prod,
Matrix< type > > 
LinAlg::operator* (Matrix< type > const &A, Matrix< type > const &B)
template<typename type >
exp_un< Matrix< type >, op_trn,
Matrix< type > > 
LinAlg::trn (Matrix< type > const &A)
template<class type , class t_exp1 >
exp_un< t_exp1, op_trn, Matrix
< type > > 
LinAlg::trn (expression< t_exp1, Matrix< type > > const &A)
template<typename type >
exp_un< Matrix< type >, op_trn,
Matrix< type > > 
LinAlg::trans (Matrix< type > const &A)
template<class type , class t_exp1 >
exp_un< t_exp1, op_trn, Matrix
< type > > 
LinAlg::trans (expression< t_exp1, Matrix< type > > const &A)
 LinAlg::DECLARE_OP_WITH_SCALAR (MATRIX_MULT_SCALAR)
 LinAlg::DECLARE_OP_WITH_SCALAR (MATRIX_DIV_SCALAR)
template<class type >
exp_bin< Vector< type >
, Matrix< type >, op_prod,
Matrix< type > > 
LinAlg::operator* (Vector< type > const &A, Matrix< type > const &B)
template<typename type >
exp_bin< Matrix< type >
, Vector< type >, op_prod,
Vector< type > > 
LinAlg::operator* (Matrix< type > const &A, Vector< type > const &B)
template<class type , class t_exp1 >
exp_bin< t_exp1, Vector< type >
, op_prod, Vector< type > > 
LinAlg::operator* (expression< t_exp1, Matrix< type > > const &A, Vector< type > const &B)
template<class type , class t_exp1 >
exp_bin< t_exp1, Matrix< type >
, op_prod, Matrix< type > > 
LinAlg::operator* (expression< t_exp1, Matrix< type > > const &A, Matrix< type > const &B)
template<class type , class t_exp1 >
exp_bin< Matrix< type >
, t_exp1, op_prod, Matrix
< type > > 
LinAlg::operator* (Matrix< type > const &A, expression< t_exp1, Matrix< type > > const &B)
template<class type , class t_exp1 , class t_exp2 >
exp_bin< t_exp1, t_exp2,
op_prod, Matrix< type > > 
LinAlg::operator* (expression< t_exp1, Matrix< type > > const &A, expression< t_exp2, Matrix< type > > const &B)
template<class type , class t_exp1 , class t_exp2 >
exp_bin< t_exp1, t_exp2,
op_prod, Vector< type > > 
LinAlg::operator* (expression< t_exp1, Matrix< type > > const &A, expression< t_exp2, Vector< type > > const &B)
template<class type , class t_exp1 , class t_exp2 >
exp_bin< t_exp1, t_exp2,
op_prod, Matrix< type > > 
LinAlg::operator* (expression< t_exp1, Vector< type > > const &A, expression< t_exp2, Matrix< type > > const &B)
template<class type >
exp_bin< Vector< type >
, Vector< type >, op_oto, type > 
LinAlg::operator* (exp_un< Vector< type >, op_trn, Matrix< type > > const &A, Vector< type > const &B)
template<class type >
exp_bin< Vector< type >
, Vector< type >, op_oot,
Matrix< type > > 
LinAlg::operator* (Vector< type > const &A, exp_un< Vector< type >, op_trn, Matrix< type > > const &B)
template<class type >
exp_bin< Matrix< type >
, Matrix< type >, op_oto,
Matrix< type > > 
LinAlg::operator* (exp_un< Matrix< type >, op_trn, Matrix< type > > const &A, Matrix< type > const &B)
template<class type >
exp_bin< Matrix< type >
, Matrix< type >, op_oot,
Matrix< type > > 
LinAlg::operator* (Matrix< type > const &A, exp_un< Matrix< type >, op_trn, Matrix< type > > const &B)
template<class type >
exp_bin< Matrix< type >
, Matrix< type >, op_otot,
Matrix< type > > 
LinAlg::operator* (exp_un< Matrix< type >, op_trn, Matrix< type > > const &A, exp_un< Matrix< type >, op_trn, Matrix< type > > const &B)

Define Documentation

#define DECLARE_OP_WITH_SCALAR (   MACRO)
Value:
MACRO(short); \
MACRO(int); \
MACRO(long int); \
MACRO(size_t); \
MACRO(float); \
MACRO(double); \
MACRO(long double);
#define EXPR_DIV_SCALAR (   T)
Value:
template <class t_obj, class t_exp1>                                                  \
inline exp_bin<T, t_exp1, op_div_sc, t_obj >                                          \
operator/(expression<t_exp1, t_obj > const & A, T const & B)                          \
{                                                                                     \
    return exp_bin<T, t_exp1, op_div_sc, t_obj >(B, static_cast<t_exp1 const &>(A));  \
}
#define EXPR_MULT_SCALAR (   T)
Value:
template <class t_obj, class t_exp1>                                                  \
inline exp_bin<T, t_exp1, op_prod_sc, t_obj >                                         \
operator*(T const & A, expression<t_exp1, t_obj > const & B)                          \
{                                                                                     \
    return exp_bin<T, t_exp1, op_prod_sc, t_obj >(A, static_cast<t_exp1 const &>(B)); \
}                                                                                     \
template <class t_obj, class t_exp1>                                                  \
inline exp_bin<T, t_exp1, op_prod_sc, t_obj >                                         \
operator*(expression<t_exp1, t_obj > const & A, T const & B)                          \
{                                                                                     \
    return exp_bin<T, t_exp1, op_prod_sc, t_obj >(B, static_cast<t_exp1 const &>(A)); \
}
#define MATRIX_DIV_SCALAR (   T)
Value:
template <class type>                                                   \
inline exp_bin<T, Matrix <type>, op_div_sc,Matrix <type> >              \
operator / (Matrix <type> const & A, T const & B)                       \
{                                                                       \
    return exp_bin<T, Matrix <type>, op_div_sc,Matrix <type> >(B,A);    \
}
#define MATRIX_MULT_SCALAR (   T)
Value:
template <class type>                                                   \
inline exp_bin< T ,Matrix <type>, op_prod_sc,Matrix <type> >            \
operator * (T const & A, Matrix <type> const & B)                       \
{                                                                       \
    return exp_bin< T,Matrix <type>, op_prod_sc,Matrix <type> >(A,B);   \
}                                                                       \
template <class type>                                                   \
inline exp_bin<T, Matrix <type>, op_prod_sc,Matrix <type> >             \
operator * (Matrix <type> const & A, T const & B)                       \
{                                                                       \
    return exp_bin<T, Matrix <type>, op_prod_sc,Matrix <type> >(B,A);   \
}
#define VECTOR_DIV_SCALAR (   T)
Value:
template <class type>                                                   \
inline                                                                  \
exp_bin<T, Vector<type>, op_div_sc, Vector<type> >                      \
operator / (Vector<type> const & A, T const & B)                        \
{                                                                       \
    return exp_bin<T, Vector<type>, op_div_sc, Vector<type> >(B,A);     \
}
#define VECTOR_MULT_SCALAR (   T)
Value:
template <class type>                                                   \
inline                                                                  \
exp_bin< T, Vector<type>, op_prod_sc, Vector<type> >                    \
operator * ( T const & A, Vector<type> const & B)                       \
{                                                                       \
    return exp_bin< T, Vector<type>, op_prod_sc, Vector<type> >(A,B);   \
}                                                                       \
template <class type>                                                   \
inline                                                                  \
exp_bin<T, Vector<type>, op_prod_sc, Vector<type> >                     \
operator * (Vector<type> const & A, T const & B)                        \
{                                                                       \
    return exp_bin<T, Vector<type>, op_prod_sc, Vector<type> >(B,A);    \
}

Function Documentation

double ddot_ ( int const *  N,
double const *  X,
int const *  incX,
double const *  Y,
int const *  incY 
)
void dgemm_ ( char const *  TransA,
char const *  TransB,
int const *  M,
int const *  N,
int const *  K,
double const *  alpha,
double const *  A,
int const *  lda,
double const *  B,
int const *  ldb,
double const *  beta,
double *  C,
int const *  ldc 
)
void dgemv_ ( char const *  TransA,
int const *  M,
int const *  N,
double const *  alpha,
double const *  A,
int const *  lda,
double const *  X,
int const *  incX,
double const *  beta,
double *  Y,
int const *  incY 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines