algebramix_doc 0.3
matrix< C, V > Class Template Reference

#include <matrix.hpp>

List of all members.

Public Member Functions


Detailed Description

template<typename C, typename V = typename matrix_variant_helper< C >::MV>
class mmx::matrix< C, V >

Examples:

bareiss_test.cpp, matrix_test.cpp, pivot_test.cpp, and series_test.cpp.

Definition at line 65 of file matrix.hpp.


Constructor & Destructor Documentation

matrix ( const format< C > &  fm = format<C> (no_format ())) [inline]

Definition at line 73 of file matrix.hpp.

                                                   {
    nat nc = Mat::def_rows;
    nat nr = Mat::def_cols;
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (tab, nr, nc, false, fm);
  }
matrix ( const T &  c) [inline]

Definition at line 82 of file matrix.hpp.

                      {
    Format fm= get_format (as<C> (c));
    nat nr = Mat::init_rows;
    nat nc = Mat::init_cols;
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (tab, nr, nc, true, fm);
    Mat::set (rep->a, C(c), nr, nc);
  }
matrix ( const T &  c,
const format< C > &  fm 
) [inline]

Definition at line 93 of file matrix.hpp.

                                        {
    nat nr = Mat::init_rows;
    nat nc = Mat::init_cols;
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (tab, nr, nc, true, fm);
    Mat::set (rep->a, C(c), nr, nc);
  }
matrix ( const matrix< T, W > &  m) [inline]

Definition at line 103 of file matrix.hpp.

                                {
    Format fm= as<Format > (CF(m));
    nat l= aligned_size<C,V> (rows(m) * cols(m));
    C*  t= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (t, rows(m), cols(m), is_a_scalar (m), fm);
    Vec::cast (rep->a, tab(m), rows(m) * cols(m));
  }
matrix ( const matrix< T, W > &  m,
const format< C > &  fm 
) [inline]

Definition at line 112 of file matrix.hpp.

                                                  {
    nat l= aligned_size<C,V> (rows(m) * cols(m));
    C*  t= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (t, rows(m), cols(m), is_a_scalar (m), fm);
    Vec::cast (rep->a, tab(m), rows(m) * cols(m));
  }
matrix ( const C x) [inline]

Definition at line 119 of file matrix.hpp.

                      {
    Format fm= get_format (x);
    nat nr = Mat::init_rows;
    nat nc = Mat::init_cols;
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (tab, nr, nc, true, fm);
    Mat::set (rep->a, x, nr, nc);
  }
matrix ( const C x,
nat  nr,
nat  nc 
) [inline]

Definition at line 129 of file matrix.hpp.

                                      {
    Format fm= get_format (x);
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    rep= new Matrix_rep (tab, nr, nc, false, fm);
    Mat::set (rep->a, x, nr, nc);
  }
matrix ( C tab,
nat  nr,
nat  nc,
const format< C > &  fm 
) [inline]

Definition at line 137 of file matrix.hpp.

                                                    {
    rep= new Matrix_rep (tab, nr, nc, false, fm);
  }
matrix ( C tab,
nat  nr,
nat  nc,
bool  flag,
const format< C > &  fm 
) [inline]

Definition at line 141 of file matrix.hpp.

                                                               {
    rep= new Matrix_rep (tab, nr, nc, flag, fm);
  }
matrix ( const iterator< C > &  it) [inline]

Definition at line 145 of file matrix.hpp.

                                 {
    Format fm= CF(it);
    nat i, j, nr= Mat::def_rows, nc= Mat::def_cols;
    if (nr==0) nr=1;
    nat l  = aligned_size<C,V> (nr * nc);
    C*  tab= mmx_formatted_new<C> (l, fm);
    for (i=0; i<nr; i++, ++it)
      for (j=0; j<nc; j++, ++it)
        tab[Mat::index (i, j, nr, nc)]= *it;
    rep= new Matrix_rep (tab, nc, nr, false, fm);
  }

Member Function Documentation

const C& operator() ( nat  i,
nat  j 
) const [inline]

Definition at line 157 of file matrix.hpp.

                                                   {
    VERIFY (is_non_scalar (*this), "non-scalar matrix expected");
    VERIFY (i<rep->nr, "row out of range");
    VERIFY (j<rep->nc, "column out of range");
    return rep->a[Mat::index (i, j, rows (*this), cols(*this))]; }
C& operator() ( nat  i,
nat  j 
) [inline]

Definition at line 162 of file matrix.hpp.

                                       {
    VERIFY (is_non_scalar (*this), "non-scalar matrix expected");
    VERIFY (i<rep->nr, "row out of range");
    VERIFY (j<rep->nc, "column out of range");
    return rep->a[Mat::index (i, j, rows (*this), cols(*this))]; }
C scalar ( ) const [inline]

Definition at line 167 of file matrix.hpp.

Referenced by mmx::binary_map(), mmx::binary_map_scalar(), mmx::binary_test(), mmx::operator*(), mmx::unary_map(), mmx::unary_set(), and mmx::unary_set_scalar().

                           {
    VERIFY (is_a_scalar (*this), "scalar matrix expected");
    return rep->a[0]; }
C& scalar ( ) [inline]

Definition at line 170 of file matrix.hpp.

                      {
    VERIFY (is_a_scalar (*this), "scalar matrix expected");
    return rep->a[0]; }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines