Skip to content
Snippets Groups Projects
Select Git revision
  • 0691b08303c200b69490a1c48b4adf2e944d255e
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

GeneralMatrix.cpp

Blame
  • GeneralMatrix.cpp 12.47 KiB
    /* $Header: /var/lib/cvs/dynare_cpp/sylv/cc/GeneralMatrix.cpp,v 1.4 2004/11/24 20:41:59 kamenik Exp $ */
    
    /* Tag $Name:  $ */
    
    
    #include "SylvException.h"
    #include "GeneralMatrix.h"
    
    #include <dynblas.h>
    #include <dynlapack.h>
    
    #include <cstdio>
    #include <cstring>
    #include <cstdlib>
    #include <cmath>
    #include <limits>
    
    int GeneralMatrix::md_length = 32;
    
    GeneralMatrix::GeneralMatrix(const GeneralMatrix& m)
    	: data(m.rows*m.cols), rows(m.rows), cols(m.cols), ld(m.rows)
    {
    	copy(m);
    }
    
    GeneralMatrix::GeneralMatrix(const ConstGeneralMatrix& m)
    	: data(m.rows*m.cols), rows(m.rows), cols(m.cols), ld(m.rows)
    {
    	copy(m);
    }
    
    GeneralMatrix::GeneralMatrix(const GeneralMatrix& m, const char* dummy)
    	: data(m.rows*m.cols), rows(m.cols), cols(m.rows), ld(m.cols)
    {
    	for (int i = 0; i < m.rows; i++)
    		for (int j = 0; j < m.cols; j++)
    			get(j,i) = m.get(i,j);
    }
    
    GeneralMatrix::GeneralMatrix(const ConstGeneralMatrix& m, const char* dummy)
    	: data(m.rows*m.cols), rows(m.cols), cols(m.rows), ld(m.cols)
    {
    	for (int i = 0; i < m.rows; i++)
    		for (int j = 0; j < m.cols; j++)
    			get(j,i) = m.get(i,j);
    }
    
    
    GeneralMatrix::GeneralMatrix(const GeneralMatrix& m, int i, int j, int nrows, int ncols)
    	: data(nrows*ncols), rows(nrows), cols(ncols), ld(nrows)
    {
    	copy(m, i, j);
    }
    
    GeneralMatrix::GeneralMatrix(GeneralMatrix& m, int i, int j, int nrows, int ncols)
    	: data(m.base()+m.ld*j+i, m.ld*(ncols-1)+nrows), rows(nrows), cols(ncols), ld(m.ld)
    {}
    
    GeneralMatrix::GeneralMatrix(const GeneralMatrix& a, const GeneralMatrix& b)
    	: data(a.rows*b.cols), rows(a.rows), cols(b.cols), ld(a.rows)
    {
    	gemm("N", a, "N", b, 1.0, 0.0);
    }
    
    GeneralMatrix::GeneralMatrix(const GeneralMatrix& a, const GeneralMatrix& b, const char* dum)
    	: data(a.rows*b.rows), rows(a.rows), cols(b.rows), ld(a.rows)
    {
    	gemm("N", a, "T", b, 1.0, 0.0);
    }