Mat_bones.hpp   Mat_bones.hpp 
skipping to change at line 263 skipping to change at line 263
arma_inline const Mat& operator--(); arma_inline const Mat& operator--();
arma_inline void operator--(int); arma_inline void operator--(int);
arma_inline arma_warn_unused bool is_empty() const; arma_inline arma_warn_unused bool is_empty() const;
arma_inline arma_warn_unused bool is_vec() const; arma_inline arma_warn_unused bool is_vec() const;
arma_inline arma_warn_unused bool is_rowvec() const; arma_inline arma_warn_unused bool is_rowvec() const;
arma_inline arma_warn_unused bool is_colvec() const; arma_inline arma_warn_unused bool is_colvec() const;
arma_inline arma_warn_unused bool is_square() const; arma_inline arma_warn_unused bool is_square() const;
inline arma_warn_unused bool is_finite() const; inline arma_warn_unused bool is_finite() const;
arma_inline arma_warn_unused bool in_range(const uword i) const; arma_inline arma_warn_unused bool in_range(const uword i) const;
arma_inline arma_warn_unused bool in_range(const span& x) const; arma_inline arma_warn_unused bool in_range(const span& x) const;
arma_inline arma_warn_unused bool in_range(const uword in_row, const uw ord in_col) const; arma_inline arma_warn_unused bool in_range(const uword in_row, const uw ord in_col) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, const uw ord in_col) const; arma_inline arma_warn_unused bool in_range(const span& row_span, const uw ord in_col) const;
arma_inline arma_warn_unused bool in_range(const uword in_row, const sp an& col_span) const; arma_inline arma_warn_unused bool in_range(const uword in_row, const sp an& col_span) const;
arma_inline arma_warn_unused bool in_range(const span& row_span, const sp an& col_span) const; arma_inline arma_warn_unused bool in_range(const span& row_span, const sp an& col_span) const;
arma_inline arma_warn_unused eT* colptr(const uword in_col); arma_inline arma_warn_unused eT* colptr(const uword in_col);
arma_inline arma_warn_unused const eT* colptr(const uword in_col) const; arma_inline arma_warn_unused const eT* colptr(const uword in_col) const;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Mat_meat.hpp   Mat_meat.hpp 
skipping to change at line 835 skipping to change at line 835
out.set_size(in_n_rows, in_n_slices); out.set_size(in_n_rows, in_n_slices);
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::copy( out.colptr(i), in.slice_colptr(i, 0), in_n_rows ) ; arrayops::copy( out.colptr(i), in.slice_colptr(i, 0), in_n_rows ) ;
} }
} }
else else
if(in_n_rows == 1) if(in_n_rows == 1)
{ {
out.set_size(in_n_slices, in_n_cols); out.set_size(in_n_cols, in_n_slices);
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); eT* out_colptr = out.colptr(slice);
for(uword i=0; i < in_n_slices; ++i) uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{ {
out_colptr[i] = in.at(0, col, i); const eT tmp_i = in.at(0, i, slice);
const eT tmp_j = in.at(0, j, slice);
out_colptr[i] = tmp_i;
out_colptr[j] = tmp_j;
}
if(i < in_n_cols)
{
out_colptr[i] = in.at(0, i, slice);
} }
} }
} }
} }
else else
{ {
out.set_size(in_n_slices); out.set_size(in_n_slices);
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
skipping to change at line 906 skipping to change at line 916
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_plus( out.colptr(i), in.slice_colptr(i, 0), in_ n_rows ); arrayops::inplace_plus( out.colptr(i), in.slice_colptr(i, 0), in_ n_rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = in.at(0, i, slice);
const eT tmp_j = in.at(0, j, slice);
out_colptr[i] += tmp_i;
out_colptr[j] += tmp_j;
}
for(uword i=0; i < in_n_slices; ++i) if(i < in_n_cols)
{ {
out_colptr[i] += in.at(0, col, i); out_colptr[i] += in.at(0, i, slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_slices; ++i) for(uword i=0; i<in_n_slices; ++i)
{ {
skipping to change at line 975 skipping to change at line 995
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_minus( out.colptr(i), in.slice_colptr(i, 0), in _n_rows ); arrayops::inplace_minus( out.colptr(i), in.slice_colptr(i, 0), in _n_rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = in.at(0, i, slice);
const eT tmp_j = in.at(0, j, slice);
for(uword i=0; i < in_n_slices; ++i) out_colptr[i] -= tmp_i;
out_colptr[j] -= tmp_j;
}
if(i < in_n_cols)
{ {
out_colptr[i] -= in.at(0, col, i); out_colptr[i] -= in.at(0, i, slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_slices; ++i) for(uword i=0; i<in_n_slices; ++i)
{ {
skipping to change at line 1059 skipping to change at line 1089
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_mul( out.colptr(i), in.slice_colptr(i, 0), in_n _rows ); arrayops::inplace_mul( out.colptr(i), in.slice_colptr(i, 0), in_n _rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = in.at(0, i, slice);
const eT tmp_j = in.at(0, j, slice);
out_colptr[i] *= tmp_i;
out_colptr[j] *= tmp_j;
}
for(uword i=0; i < in_n_slices; ++i) if(i < in_n_cols)
{ {
out_colptr[i] *= in.at(0, col, i); out_colptr[i] *= in.at(0, i, slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_slices; ++i) for(uword i=0; i<in_n_slices; ++i)
{ {
skipping to change at line 1128 skipping to change at line 1168
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_div( out.colptr(i), in.slice_colptr(i, 0), in_n _rows ); arrayops::inplace_div( out.colptr(i), in.slice_colptr(i, 0), in_n _rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = in.at(0, i, slice);
const eT tmp_j = in.at(0, j, slice);
out_colptr[i] /= tmp_i;
out_colptr[j] /= tmp_j;
}
for(uword i=0; i < in_n_slices; ++i) if(i < in_n_cols)
{ {
out_colptr[i] /= in.at(0, col, i); out_colptr[i] /= in.at(0, i, slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
for(uword i=0; i<in_n_slices; ++i) for(uword i=0; i<in_n_slices; ++i)
{ {
 End of changes. 25 change blocks. 
25 lines changed or deleted 75 lines changed or added


 arma_version.hpp   arma_version.hpp 
skipping to change at line 18 skipping to change at line 18
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup arma_version //! \addtogroup arma_version
//! @{ //! @{
#define ARMA_VERSION_MAJOR 2 #define ARMA_VERSION_MAJOR 2
#define ARMA_VERSION_MINOR 3 #define ARMA_VERSION_MINOR 3
#define ARMA_VERSION_PATCH 91 #define ARMA_VERSION_PATCH 92
#define ARMA_VERSION_NAME "Loco Lounge Lizard (Beta 1)" #define ARMA_VERSION_NAME "Loco Lounge Lizard (Beta 2)"
struct arma_version struct arma_version
{ {
static const unsigned int major = ARMA_VERSION_MAJOR; static const unsigned int major = ARMA_VERSION_MAJOR;
static const unsigned int minor = ARMA_VERSION_MINOR; static const unsigned int minor = ARMA_VERSION_MINOR;
static const unsigned int patch = ARMA_VERSION_PATCH; static const unsigned int patch = ARMA_VERSION_PATCH;
static static
inline inline
std::string std::string
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 armadillo   armadillo 
skipping to change at line 66 skipping to change at line 66
#endif #endif
#if defined(ARMA_USE_BOOST) #if defined(ARMA_USE_BOOST)
#if defined(ARMA_EXTRA_DEBUG) #if defined(ARMA_EXTRA_DEBUG)
#include <boost/format.hpp> #include <boost/format.hpp>
#include <boost/current_function.hpp> #include <boost/current_function.hpp>
#define ARMA_USE_BOOST_FORMAT #define ARMA_USE_BOOST_FORMAT
#endif #endif
#endif #endif
#define ARMA_INCFILE_WRAP(x) <x> #include "armadillo_bits/include_atlas.hpp"
#if defined(ARMA_USE_ATLAS)
#if !defined(ARMA_ATLAS_INCLUDE_DIR)
extern "C"
{
#include <cblas.h>
#include <clapack.h>
}
#else
#define ARMA_STR1(x) x
#define ARMA_STR2(x) ARMA_STR1(x)
#define ARMA_CBLAS ARMA_STR2(ARMA_ATLAS_INCLUDE_DIR)ARMA_STR2(cblas.h
)
#define ARMA_CLAPACK ARMA_STR2(ARMA_ATLAS_INCLUDE_DIR)ARMA_STR2(clapack
.h)
extern "C"
{
#include ARMA_INCFILE_WRAP(ARMA_CBLAS)
#include ARMA_INCFILE_WRAP(ARMA_CLAPACK)
}
#undef ARMA_STR1
#undef ARMA_STR2
#undef ARMA_CBLAS
#undef ARMA_CLAPACK
#endif
#endif
#include "armadillo_bits/itpp_wrap.hpp" #include "armadillo_bits/itpp_wrap.hpp"
//! \namespace arma namespace for Armadillo classes and functions //! \namespace arma namespace for Armadillo classes and functions
namespace arma namespace arma
{ {
// preliminaries // preliminaries
#include "armadillo_bits/forward_bones.hpp" #include "armadillo_bits/forward_bones.hpp"
#include "armadillo_bits/arma_static_check.hpp" #include "armadillo_bits/arma_static_check.hpp"
#include "armadillo_bits/typedef.hpp" #include "armadillo_bits/typedef.hpp"
#include "armadillo_bits/typedef_blas_int.hpp"
#include "armadillo_bits/format_wrap.hpp" #include "armadillo_bits/format_wrap.hpp"
#include "armadillo_bits/arma_version.hpp" #include "armadillo_bits/arma_version.hpp"
#include "armadillo_bits/arma_config.hpp" #include "armadillo_bits/arma_config.hpp"
#include "armadillo_bits/traits.hpp" #include "armadillo_bits/traits.hpp"
#include "armadillo_bits/promote_type.hpp" #include "armadillo_bits/promote_type.hpp"
#include "armadillo_bits/upgrade_val.hpp" #include "armadillo_bits/upgrade_val.hpp"
#include "armadillo_bits/restrictors.hpp" #include "armadillo_bits/restrictors.hpp"
#include "armadillo_bits/access.hpp" #include "armadillo_bits/access.hpp"
#include "armadillo_bits/span.hpp" #include "armadillo_bits/span.hpp"
#include "armadillo_bits/constants.hpp" #include "armadillo_bits/constants.hpp"
skipping to change at line 127 skipping to change at line 100
// //
// class prototypes // class prototypes
#include "armadillo_bits/Base_bones.hpp" #include "armadillo_bits/Base_bones.hpp"
#include "armadillo_bits/BaseCube_bones.hpp" #include "armadillo_bits/BaseCube_bones.hpp"
#include "armadillo_bits/blas_bones.hpp" #include "armadillo_bits/blas_bones.hpp"
#include "armadillo_bits/lapack_bones.hpp" #include "armadillo_bits/lapack_bones.hpp"
#include "armadillo_bits/atlas_bones.hpp" #include "armadillo_bits/atlas_bones.hpp"
#include "armadillo_bits/blas_wrapper.hpp"
#include "armadillo_bits/lapack_wrapper.hpp"
#include "armadillo_bits/atlas_wrapper.hpp"
#include "armadillo_bits/arrayops_bones.hpp" #include "armadillo_bits/arrayops_bones.hpp"
#include "armadillo_bits/podarray_bones.hpp" #include "armadillo_bits/podarray_bones.hpp"
#include "armadillo_bits/auxlib_bones.hpp" #include "armadillo_bits/auxlib_bones.hpp"
#include "armadillo_bits/injector_bones.hpp" #include "armadillo_bits/injector_bones.hpp"
#include "armadillo_bits/Mat_bones.hpp" #include "armadillo_bits/Mat_bones.hpp"
#include "armadillo_bits/Col_bones.hpp" #include "armadillo_bits/Col_bones.hpp"
#include "armadillo_bits/Row_bones.hpp" #include "armadillo_bits/Row_bones.hpp"
#include "armadillo_bits/Cube_bones.hpp" #include "armadillo_bits/Cube_bones.hpp"
 End of changes. 3 change blocks. 
31 lines changed or deleted 6 lines changed or added


 atlas_bones.hpp   atlas_bones.hpp 
// Copyright (C) 2008-2010 NICTA (www.nicta.com.au) // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
// Copyright (C) 2008-2010 Conrad Sanderson // Copyright (C) 2008-2011 Conrad Sanderson
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
#ifdef ARMA_USE_ATLAS #ifdef ARMA_USE_ATLAS
//! \namespace atlas namespace for ATLAS functions (imported from the globa l namespace) //! \namespace atlas namespace for ATLAS functions (imported from the globa l namespace)
namespace atlas namespace atlas
{ {
using ::CblasColMajor; using ::CblasColMajor;
using ::CblasNoTrans; using ::CblasNoTrans;
using ::CblasTrans; using ::CblasTrans;
using ::CblasConjTrans;
using ::cblas_sdot; #if defined(ARMA_USE_WRAPPER)
using ::cblas_ddot; extern "C"
using ::cblas_cdotu_sub;
using ::cblas_zdotu_sub;
using ::cblas_sgemv;
using ::cblas_dgemv;
using ::cblas_cgemv;
using ::cblas_zgemv;
using ::cblas_sgemm;
using ::cblas_dgemm;
using ::cblas_cgemm;
using ::cblas_zgemm;
using ::clapack_sgetrf;
using ::clapack_dgetrf;
using ::clapack_cgetrf;
using ::clapack_zgetrf;
using ::clapack_sgetri;
using ::clapack_dgetri;
using ::clapack_cgetri;
using ::clapack_zgetri;
template<typename eT>
inline static const eT& tmp_real(const eT& X) { return X; }
template<typename T>
inline static const T& tmp_real(const std::complex<T>& X) { return X.rea
l(); }
template<typename eT>
arma_inline
eT
cblas_dot(const int N, const eT* X, const eT* Y)
{ {
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) float wrapper_cblas_sdot(const int N, const float *X, const int incX,
{ const float *Y, const int incY);
typedef float T; double wrapper_cblas_ddot(const int N, const double *X, const int incX,
return eT( cblas_sdot(N, (const T*)X, 1, (const T*)Y, 1) ); const double *Y, const int incY);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
return eT( cblas_ddot(N, (const T*)X, 1, (const T*)Y, 1) );
}
else
{
return eT(0);
}
}
template<typename eT> void wrapper_cblas_cdotu_sub(const int N, const void *X, const int incX
arma_inline , const void *Y, const int incY, void *dotu);
eT void wrapper_cblas_zdotu_sub(const int N, const void *X, const int incX
cx_cblas_dot(const int N, const eT* X, const eT* Y) , const void *Y, const int incY, void *dotu);
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_supported_complex_float<eT>::value == true) void wrapper_cblas_sgemv(const enum CBLAS_ORDER Order, const enum CBLAS
{ _TRANSPOSE TransA, const int M, const int N, const float alpha,
typedef typename std::complex<float> T; const float *A, const int lda, const float *X,
const int incX, const float beta, float *Y, const int incY);
T out;
cblas_cdotu_sub(N, (const T*)X, 1, (const T*)Y, 1, &out);
return eT(out);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef typename std::complex<double> T;
T out;
cblas_zdotu_sub(N, (const T*)X, 1, (const T*)Y, 1, &out);
return eT(out);
}
else
{
return eT(0);
}
}
template<typename eT> void wrapper_cblas_dgemv(const enum CBLAS_ORDER Order, const enum CBLAS
inline _TRANSPOSE TransA, const int M, const int N, const double alpha,
void const double *A, const int lda, const double *
cblas_gemv X, const int incX, const double beta, double *Y, const int incY);
(
const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
const int M, const int N,
const eT alpha,
const eT *A, const int lda,
const eT *X, const int incX,
const eT beta,
eT *Y, const int incY
)
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) void wrapper_cblas_cgemv(const enum CBLAS_ORDER Order, const enum CBLAS
{ _TRANSPOSE TransA, const int M, const int N, const void *alpha,
typedef float T; const void *A, const int lda, const void *X, c
cblas_sgemv(Order, TransA, M, N, (const T)tmp_real(alpha), (const T*) onst int incX, const void *beta, void *Y, const int incY);
A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, incY);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
cblas_dgemv(Order, TransA, M, N, (const T)tmp_real(alpha), (const T*)
A, lda, (const T*)X, incX, (const T)tmp_real(beta), (T*)Y, incY);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
cblas_cgemv(Order, TransA, M, N, (const T*)&alpha, (const T*)A, lda,
(const T*)X, incX, (const T*)&beta, (T*)Y, incY);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
cblas_zgemv(Order, TransA, M, N, (const T*)&alpha, (const T*)A, lda,
(const T*)X, incX, (const T*)&beta, (T*)Y, incY);
}
}
template<typename eT> void wrapper_cblas_zgemv(const enum CBLAS_ORDER Order, const enum CBLAS
inline _TRANSPOSE TransA, const int M, const int N, const void *alpha,
void const void *A, const int lda, const void *X, c
cblas_gemm onst int incX, const void *beta, void *Y, const int incY);
(
const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
const int K, const eT alpha, const eT *A,
const int lda, const eT *B, const int ldb,
const eT beta, eT *C, const int ldc
)
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) void wrapper_cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS
{ _TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
typedef float T; const int M, const int N, const int K, const f
cblas_sgemm(Order, TransA, TransB, M, N, K, (const T)tmp_real(alpha), loat alpha,
(const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), (T*)C, ldc); const float *A, const int lda, const float *B,
} const int ldb, const float beta, float *C, const int ldc);
else
if(is_double<eT>::value == true)
{
typedef double T;
cblas_dgemm(Order, TransA, TransB, M, N, K, (const T)tmp_real(alpha),
(const T*)A, lda, (const T*)B, ldb, (const T)tmp_real(beta), (T*)C, ldc);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
cblas_cgemm(Order, TransA, TransB, M, N, K, (const T*)&alpha, (const
T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
cblas_zgemm(Order, TransA, TransB, M, N, K, (const T*)&alpha, (const
T*)A, lda, (const T*)B, ldb, (const T*)&beta, (T*)C, ldc);
}
}
template<typename eT> void wrapper_cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS
inline _TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
int const int M, const int N, const int K, const d
clapack_getrf ouble alpha,
( const double *A, const int lda, const double *
const enum CBLAS_ORDER Order, const int M, const int N, B, const int ldb, const double beta, double *C, const int ldc);
eT *A, const int lda, int *ipiv
)
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true) void wrapper_cblas_cgemm(const enum CBLAS_ORDER Order, const enum CBLAS
{ _TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
typedef float T; const int M, const int N, const int K, const v
return clapack_sgetrf(Order, M, N, (T*)A, lda, ipiv); oid *alpha,
} const void *A, const int lda, const void *B, c
else onst int ldb, const void *beta, void *C, const int ldc);
if(is_double<eT>::value == true)
{
typedef double T;
return clapack_dgetrf(Order, M, N, (T*)A, lda, ipiv);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
return clapack_cgetrf(Order, M, N, (T*)A, lda, ipiv);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
return clapack_zgetrf(Order, M, N, (T*)A, lda, ipiv);
}
else
{
return -1;
}
}
template<typename eT> void wrapper_cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS
inline _TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
int const int M, const int N, const int K, const v
clapack_getri oid *alpha,
( const void *A, const int lda, const void *B, c
const enum CBLAS_ORDER Order, const int N, eT *A, onst int ldb, const void *beta, void *C, const int ldc);
const int lda, const int *ipiv
) int wrapper_clapack_sgetrf(const enum CBLAS_ORDER Order, const int M, c
{ onst int N, float *A, const int lda, int *ipiv);
arma_type_check((is_supported_blas_type<eT>::value == false)); int wrapper_clapack_dgetrf(const enum CBLAS_ORDER Order, const int M, c
onst int N, double *A, const int lda, int *ipiv);
int wrapper_clapack_cgetrf(const enum CBLAS_ORDER Order, const int M, c
onst int N, void *A, const int lda, int *ipiv);
int wrapper_clapack_zgetrf(const enum CBLAS_ORDER Order, const int M, c
onst int N, void *A, const int lda, int *ipiv);
int wrapper_clapack_sgetri(const enum CBLAS_ORDER Order, const int N, f
loat *A, const int lda, const int *ipiv);
int wrapper_clapack_dgetri(const enum CBLAS_ORDER Order, const int N, d
ouble *A, const int lda, const int *ipiv);
int wrapper_clapack_cgetri(const enum CBLAS_ORDER Order, const int N, v
oid *A, const int lda, const int *ipiv);
int wrapper_clapack_zgetri(const enum CBLAS_ORDER Order, const int N, v
oid *A, const int lda, const int *ipiv);
int wrapper_clapack_sgesv(const enum CBLAS_ORDER Order, const int N, co
nst int NRHS, float *A, const int lda, int *ipiv, float *B, const int ldb
);
int wrapper_clapack_dgesv(const enum CBLAS_ORDER Order, const int N, co
nst int NRHS, double *A, const int lda, int *ipiv, double *B, const int ldb
);
int wrapper_clapack_cgesv(const enum CBLAS_ORDER Order, const int N, co
nst int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb
);
int wrapper_clapack_zgesv(const enum CBLAS_ORDER Order, const int N, co
nst int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb
);
if(is_float<eT>::value == true)
{
typedef float T;
return clapack_sgetri(Order, N, (T*)A, lda, ipiv);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
return clapack_dgetri(Order, N, (T*)A, lda, ipiv);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
return clapack_cgetri(Order, N, (T*)A, lda, ipiv);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
return clapack_zgetri(Order, N, (T*)A, lda, ipiv);
}
else
{
return -1;
}
} }
#endif
} }
#endif #endif
 End of changes. 16 change blocks. 
244 lines changed or deleted 85 lines changed or added


 auxlib_meat.hpp   auxlib_meat.hpp 
skipping to change at line 2360 skipping to change at line 2360
out.set_size(A_n_rows, B.n_cols); out.set_size(A_n_rows, B.n_cols);
gemm_emul<false,false,false,false>::apply(out, A_inv, B); gemm_emul<false,false,false,false>::apply(out, A_inv, B);
return true; return true;
} }
} }
if( (A_n_rows > 4) || (status == false) ) if( (A_n_rows > 4) || (status == false) )
{ {
#if defined(ARMA_USE_LAPACK) #if defined(ARMA_USE_ATLAS)
{
podarray<int> ipiv(A_n_rows);
out = B;
int info = atlas::clapack_gesv<eT>(atlas::CblasColMajor, A_n_rows,
B.n_cols, A.memptr(), A_n_rows, ipiv.memptr(), out.memptr(), A_n_rows);
return (info == 0);
}
#elif defined(ARMA_USE_LAPACK)
{ {
blas_int n = A_n_rows; blas_int n = A_n_rows;
blas_int lda = A_n_rows; blas_int lda = A_n_rows;
blas_int ldb = A_n_rows; blas_int ldb = A_n_rows;
blas_int nrhs = B.n_cols; blas_int nrhs = B.n_cols;
blas_int info; blas_int info;
podarray<blas_int> ipiv(A_n_rows); podarray<blas_int> ipiv(A_n_rows);
out = B; out = B;
lapack::gesv<eT>(&n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.me mptr(), &ldb, &info); lapack::gesv<eT>(&n, &nrhs, A.memptr(), &lda, ipiv.memptr(), out.me mptr(), &ldb, &info);
return (info == 0); return (info == 0);
} }
#else #else
{ {
arma_stop("solve(): use of LAPACK needs to be enabled"); arma_stop("solve(): use of ATLAS or LAPACK needs to be enabled");
return false; return false;
} }
#endif #endif
} }
} }
return true; return true;
} }
//! Solve an over-determined system. //! Solve an over-determined system.
 End of changes. 2 change blocks. 
2 lines changed or deleted 13 lines changed or added


 blas_bones.hpp   blas_bones.hpp 
skipping to change at line 47 skipping to change at line 47
#define arma_cgemv CGEMV #define arma_cgemv CGEMV
#define arma_zgemv ZGEMV #define arma_zgemv ZGEMV
#define arma_sgemm SGEMM #define arma_sgemm SGEMM
#define arma_dgemm DGEMM #define arma_dgemm DGEMM
#define arma_cgemm CGEMM #define arma_cgemm CGEMM
#define arma_zgemm ZGEMM #define arma_zgemm ZGEMM
#endif #endif
//! \namespace blas namespace for BLAS functions extern "C"
namespace blas
{ {
extern "C" float arma_fortran(arma_sdot)(blas_int* n, const float* x, blas_int* in
{ cx, const float* y, blas_int* incy);
float arma_fortran(arma_sdot)(blas_int* n, const float* x, blas_int* double arma_fortran(arma_ddot)(blas_int* n, const double* x, blas_int* in
incx, const float* y, blas_int* incy); cx, const double* y, blas_int* incy);
double arma_fortran(arma_ddot)(blas_int* n, const double* x, blas_int*
incx, const double* y, blas_int* incy);
void arma_fortran(arma_sgemv)(const char* transA, const blas_int* m, co
nst blas_int* n, const float* alpha, const float* A, const blas_int* ldA,
const float* x, const blas_int* incx, const float* beta, float* y, cons
t blas_int* incy);
void arma_fortran(arma_dgemv)(const char* transA, const blas_int* m, co
nst blas_int* n, const double* alpha, const double* A, const blas_int* ldA,
const double* x, const blas_int* incx, const double* beta, double* y, cons
t blas_int* incy);
void arma_fortran(arma_cgemv)(const char* transA, const blas_int* m, co
nst blas_int* n, const void* alpha, const void* A, const blas_int* ldA,
const void* x, const blas_int* incx, const void* beta, void* y, cons
t blas_int* incy);
void arma_fortran(arma_zgemv)(const char* transA, const blas_int* m, co
nst blas_int* n, const void* alpha, const void* A, const blas_int* ldA,
const void* x, const blas_int* incx, const void* beta, void* y, cons
t blas_int* incy);
void arma_fortran(arma_sgemm)(const char* transA, const char* transB, c
onst blas_int* m, const blas_int* n, const blas_int* k, const float* alpha
, const float* A, const blas_int* ldA, const float* B, const blas_int* ld
B, const float* beta, float* C, const blas_int* ldC);
void arma_fortran(arma_dgemm)(const char* transA, const char* transB, c
onst blas_int* m, const blas_int* n, const blas_int* k, const double* alpha
, const double* A, const blas_int* ldA, const double* B, const blas_int* ld
B, const double* beta, double* C, const blas_int* ldC);
void arma_fortran(arma_cgemm)(const char* transA, const char* transB, c
onst blas_int* m, const blas_int* n, const blas_int* k, const void* alpha
, const void* A, const blas_int* ldA, const void* B, const blas_int* ld
B, const void* beta, void* C, const blas_int* ldC);
void arma_fortran(arma_zgemm)(const char* transA, const char* transB, c
onst blas_int* m, const blas_int* n, const blas_int* k, const void* alpha
, const void* A, const blas_int* ldA, const void* B, const blas_int* ld
B, const void* beta, void* C, const blas_int* ldC);
// void arma_fortran(arma_dswap)(const blas_int* n, double* x, const
blas_int* incx, double* y, const blas_int* incy);
// void arma_fortran(arma_dscal)(const blas_int* n, const double* alp
ha, double* x, const blas_int* incx);
// void arma_fortran(arma_dcopy)(const blas_int* n, const double* x,
const blas_int* incx, double* y, const blas_int* incy);
// void arma_fortran(arma_daxpy)(const blas_int* n, const double* alp
ha, const double* x, const blas_int* incx, double* y, const blas_int* incy)
;
// void arma_fortran(arma_dger )(const blas_int* m, const blas_int* n
, const double* alpha, const double* x, const blas_int* incx, const double*
y, const blas_int* incy, double* A, const blas_int* ldA);
}
template<typename eT>
inline
eT
dot(const uword n_elem, const eT* x, const eT* y)
{
arma_ignore(n_elem);
arma_ignore(x);
arma_ignore(y);
return eT(0);
}
template<>
inline
float
dot(const uword n_elem, const float* x, const float* y)
{
blas_int n = blas_int(n_elem);
blas_int inc = blas_int(1);
return arma_fortran(arma_sdot)(&n, x, &inc, y, &inc);
}
template<>
inline
double
dot(const uword n_elem, const double* x, const double* y)
{
blas_int n = blas_int(n_elem);
blas_int inc = blas_int(1);
return arma_fortran(arma_ddot)(&n, x, &inc, y, &inc);
}
template<typename eT>
inline
void
gemv(const char* transA, const blas_int* m, const blas_int* n, const eT*
alpha, const eT* A, const blas_int* ldA, const eT* x, const blas_int* incx,
const eT* beta, eT* y, const blas_int* incy)
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgemv)(transA, m, n, (const T*)alpha, (const T*)A,
ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgemv)(transA, m, n, (const T*)alpha, (const T*)A,
ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgemv)(transA, m, n, (const T*)alpha, (const T*)A,
ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgemv)(transA, m, n, (const T*)alpha, (const T*)A,
ldA, (const T*)x, incx, (const T*)beta, (T*)y, incy);
}
}
template<typename eT>
inline
void
gemm(const char* transA, const char* transB, const blas_int* m, const bla
s_int* n, const blas_int* k, const eT* alpha, const eT* A, const blas_int*
ldA, const eT* B, const blas_int* ldB, const eT* beta, eT* C, const blas_in
t* ldC)
{
arma_type_check((is_supported_blas_type<eT>::value == false));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgemm)(transA, transB, m, n, k, (const T*)alpha, (c
onst T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgemm)(transA, transB, m, n, k, (const T*)alpha, (c
onst T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgemm)(transA, transB, m, n, k, (const T*)alpha, (c
onst T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgemm)(transA, transB, m, n, k, (const T*)alpha, (c
onst T*)A, ldA, (const T*)B, ldB, (const T*)beta, (T*)C, ldC);
}
}
void arma_fortran(arma_sgemv)(const char* transA, const blas_int* m, cons
t blas_int* n, const float* alpha, const float* A, const blas_int* ldA, c
onst float* x, const blas_int* incx, const float* beta, float* y, const
blas_int* incy);
void arma_fortran(arma_dgemv)(const char* transA, const blas_int* m, cons
t blas_int* n, const double* alpha, const double* A, const blas_int* ldA, c
onst double* x, const blas_int* incx, const double* beta, double* y, const
blas_int* incy);
void arma_fortran(arma_cgemv)(const char* transA, const blas_int* m, cons
t blas_int* n, const void* alpha, const void* A, const blas_int* ldA, c
onst void* x, const blas_int* incx, const void* beta, void* y, const
blas_int* incy);
void arma_fortran(arma_zgemv)(const char* transA, const blas_int* m, cons
t blas_int* n, const void* alpha, const void* A, const blas_int* ldA, c
onst void* x, const blas_int* incx, const void* beta, void* y, const
blas_int* incy);
void arma_fortran(arma_sgemm)(const char* transA, const char* transB, con
st blas_int* m, const blas_int* n, const blas_int* k, const float* alpha,
const float* A, const blas_int* ldA, const float* B, const blas_int* ldB,
const float* beta, float* C, const blas_int* ldC);
void arma_fortran(arma_dgemm)(const char* transA, const char* transB, con
st blas_int* m, const blas_int* n, const blas_int* k, const double* alpha,
const double* A, const blas_int* ldA, const double* B, const blas_int* ldB,
const double* beta, double* C, const blas_int* ldC);
void arma_fortran(arma_cgemm)(const char* transA, const char* transB, con
st blas_int* m, const blas_int* n, const blas_int* k, const void* alpha,
const void* A, const blas_int* ldA, const void* B, const blas_int* ldB,
const void* beta, void* C, const blas_int* ldC);
void arma_fortran(arma_zgemm)(const char* transA, const char* transB, con
st blas_int* m, const blas_int* n, const blas_int* k, const void* alpha,
const void* A, const blas_int* ldA, const void* B, const blas_int* ldB,
const void* beta, void* C, const blas_int* ldC);
// void arma_fortran(arma_dswap)(const blas_int* n, double* x, const bl
as_int* incx, double* y, const blas_int* incy);
// void arma_fortran(arma_dscal)(const blas_int* n, const double* alpha
, double* x, const blas_int* incx);
// void arma_fortran(arma_dcopy)(const blas_int* n, const double* x, co
nst blas_int* incx, double* y, const blas_int* incy);
// void arma_fortran(arma_daxpy)(const blas_int* n, const double* alpha
, const double* x, const blas_int* incx, double* y, const blas_int* incy);
// void arma_fortran(arma_dger )(const blas_int* m, const blas_int* n,
const double* alpha, const double* x, const blas_int* incx, const double* y
, const blas_int* incy, double* A, const blas_int* ldA);
} }
#endif #endif
 End of changes. 3 change blocks. 
169 lines changed or deleted 50 lines changed or added


 compiler_setup.hpp   compiler_setup.hpp 
skipping to change at line 24 skipping to change at line 24
#define arma_cold #define arma_cold
#define arma_pure #define arma_pure
#define arma_const #define arma_const
#define arma_inline inline #define arma_inline inline
#define arma_aligned #define arma_aligned
#define arma_warn_unused #define arma_warn_unused
#define arma_deprecated #define arma_deprecated
#define arma_ignore(variable) ((void)(variable)) #define arma_ignore(variable) ((void)(variable))
#if defined(ARMA_BLAS_UNDERSCORE) #if defined(ARMA_BLAS_UNDERSCORE)
#define arma_fortran2(function) function##_ #define arma_fortran2_noprefix(function) function##_
#define arma_fortran2_prefix(function) wrapper_##function##_
#else #else
#define arma_fortran2(function) function #define arma_fortran2_prefix(function) wrapper_##function
#define arma_fortran2_noprefix(function) function
#endif #endif
#define arma_fortran(function) arma_fortran2(function) #if defined(ARMA_USE_WRAPPER)
#define arma_fortran(function) arma_fortran2_prefix(function)
#define arma_atlas(function) wrapper_##function
#else
#define arma_fortran(function) arma_fortran2_noprefix(function)
#define arma_atlas(function) function
#endif
#define arma_fortran_prefix(function) arma_fortran2_prefix(function)
#define arma_fortran_noprefix(function) arma_fortran2_noprefix(function)
#define ARMA_INCFILE_WRAP(x) <x>
#if defined(__INTEL_COMPILER) #if defined(__INTEL_COMPILER)
#if (__INTEL_COMPILER < 1000) #if (__INTEL_COMPILER < 1000)
#error "*** Need a newer compiler ***" #error "*** Need a newer compiler ***"
#endif #endif
#define ARMA_GOOD_COMPILER #define ARMA_GOOD_COMPILER
#undef ARMA_HAVE_STD_TR1 #undef ARMA_HAVE_STD_TR1
 End of changes. 3 change blocks. 
3 lines changed or deleted 16 lines changed or added


 config.hpp   config.hpp 
skipping to change at line 68 skipping to change at line 68
//// Uncomment the above line if you want to use Intel TBB scalable_malloc( ) and scalable_free() instead of standard new[] and delete[] //// Uncomment the above line if you want to use Intel TBB scalable_malloc( ) and scalable_free() instead of standard new[] and delete[]
#define ARMA_USE_ATLAS #define ARMA_USE_ATLAS
#define ARMA_ATLAS_INCLUDE_DIR /usr/include/ #define ARMA_ATLAS_INCLUDE_DIR /usr/include/
//// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h //// If you're using ATLAS and the compiler can't find cblas.h and/or clapa ck.h
//// uncomment the above define and specify the appropriate include directo ry. //// uncomment the above define and specify the appropriate include directo ry.
//// Make sure the directory has a trailing / //// Make sure the directory has a trailing /
#define ARMA_USE_BOOST #define ARMA_USE_BOOST
#define ARMA_USE_BOOST_DATE #define ARMA_USE_BOOST_DATE
#define ARMA_USE_WRAPPER
#define ARMA_PRINT_LOGIC_ERRORS #define ARMA_PRINT_LOGIC_ERRORS
#define ARMA_PRINT_RUNTIME_ERRORS #define ARMA_PRINT_RUNTIME_ERRORS
#define ARMA_HAVE_STD_ISFINITE #define ARMA_HAVE_STD_ISFINITE
#define ARMA_HAVE_STD_ISINF #define ARMA_HAVE_STD_ISINF
#define ARMA_HAVE_STD_ISNAN #define ARMA_HAVE_STD_ISNAN
#define ARMA_HAVE_STD_SNPRINTF #define ARMA_HAVE_STD_SNPRINTF
#define ARMA_HAVE_LOG1P #define ARMA_HAVE_LOG1P
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 debug.hpp   debug.hpp 
skipping to change at line 380 skipping to change at line 380
arma_incompat_size_string(const subview_cube<eT>& Q, const Mat<eT>& A, cons t char* x) arma_incompat_size_string(const subview_cube<eT>& Q, const Mat<eT>& A, cons t char* x)
{ {
std::stringstream tmp; std::stringstream tmp;
tmp << x tmp << x
<< ": interpreting matrix as cube with dimenensions: " << ": interpreting matrix as cube with dimenensions: "
<< A.n_rows << 'x' << A.n_cols << 'x' << 1 << A.n_rows << 'x' << A.n_cols << 'x' << 1
<< " or " << " or "
<< A.n_rows << 'x' << 1 << 'x' << A.n_cols << A.n_rows << 'x' << 1 << 'x' << A.n_cols
<< " or " << " or "
<< 1 << 'x' << A.n_cols << 'x' << A.n_rows << 1 << 'x' << A.n_rows << 'x' << A.n_cols
<< " is incompatible with cube dimensions: " << " is incompatible with cube dimensions: "
<< Q.n_rows << 'x' << Q.n_cols << 'x' << Q.n_slices; << Q.n_rows << 'x' << Q.n_cols << 'x' << Q.n_slices;
return tmp.str(); return tmp.str();
} }
// //
// functions for checking whether two matrices have the same dimensions // functions for checking whether two matrices have the same dimensions
inline inline
skipping to change at line 782 skipping to change at line 782
const uword M_n_cols = M.n_cols; const uword M_n_cols = M.n_cols;
if(M_vec_state == 0) if(M_vec_state == 0)
{ {
if( if(
( (
( (Q_n_rows == M_n_rows) && (Q_n_cols == M_n_cols) ) ( (Q_n_rows == M_n_rows) && (Q_n_cols == M_n_cols) )
|| ||
( (Q_n_rows == M_n_rows) && (Q_n_slices == M_n_cols) ) ( (Q_n_rows == M_n_rows) && (Q_n_slices == M_n_cols) )
|| ||
( (Q_n_cols == M_n_cols) && (Q_n_slices == M_n_rows) ) ( (Q_n_cols == M_n_rows) && (Q_n_slices == M_n_cols) )
) )
== false == false
) )
{ {
std::stringstream tmp; std::stringstream tmp;
tmp << x tmp << x
<< ": can't interpret cube with dimenensions " << ": can't interpret cube with dimenensions "
<< Q_n_rows << 'x' << Q_n_cols << 'x' << Q_n_slices << Q_n_rows << 'x' << Q_n_cols << 'x' << Q_n_slices
<< " as a matrix with dimensions " << " as a matrix with dimensions "
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 diagview_bones.hpp   diagview_bones.hpp 
skipping to change at line 31 skipping to change at line 31
protected: arma_aligned Mat<eT>* m_ptr; protected: arma_aligned Mat<eT>* m_ptr;
public: public:
typedef eT elem_type; typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type; typedef typename get_pod_type<eT>::result pod_type;
const uword row_offset; const uword row_offset;
const uword col_offset; const uword col_offset;
const uword n_rows; // equal to n_elem const uword n_rows; // equal to n_elem
const uword n_cols; // always 1
const uword n_elem; const uword n_elem;
static const uword n_cols = 1;
protected: protected:
arma_inline diagview(const Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword len); arma_inline diagview(const Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword len);
arma_inline diagview( Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword len); arma_inline diagview( Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword len);
public: public:
inline ~diagview(); inline ~diagview();
inline void operator=(const diagview& x); inline void operator=(const diagview& x);
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 diagview_meat.hpp   diagview_meat.hpp 
skipping to change at line 31 skipping to change at line 31
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
diagview<eT>::diagview(const Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword in_len) diagview<eT>::diagview(const Mat<eT>& in_m, const uword in_row_offset, cons t uword in_col_offset, const uword in_len)
: m(in_m) : m(in_m)
, m_ptr(0) , m_ptr(0)
, row_offset(in_row_offset) , row_offset(in_row_offset)
, col_offset(in_col_offset) , col_offset(in_col_offset)
, n_rows(in_len) , n_rows(in_len)
, n_cols(1)
, n_elem(in_len) , n_elem(in_len)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
template<typename eT> template<typename eT>
arma_inline arma_inline
diagview<eT>::diagview(Mat<eT>& in_m, const uword in_row_offset, const uwor d in_col_offset, const uword in_len) diagview<eT>::diagview(Mat<eT>& in_m, const uword in_row_offset, const uwor d in_col_offset, const uword in_len)
: m(in_m) : m(in_m)
, m_ptr(&in_m) , m_ptr(&in_m)
, row_offset(in_row_offset) , row_offset(in_row_offset)
, col_offset(in_col_offset) , col_offset(in_col_offset)
, n_rows(in_len) , n_rows(in_len)
, n_cols(1)
, n_elem(in_len) , n_elem(in_len)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
} }
//! set a diagonal of our matrix using a diagonal from a foreign matrix //! set a diagonal of our matrix using a diagonal from a foreign matrix
template<typename eT> template<typename eT>
inline inline
void void
diagview<eT>::operator= (const diagview<eT>& x) diagview<eT>::operator= (const diagview<eT>& x)
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added


 fn_accu.hpp   fn_accu.hpp 
skipping to change at line 33 skipping to change at line 33
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type; typedef typename Proxy<T1>::ea_type ea_type;
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
if(Proxy<T1>::prefer_at_accessor == false) if(Proxy<T1>::prefer_at_accessor == false)
{ {
ea_type P = A.get_ea(); ea_type P = A.get_ea();
const uword n_elem = A.get_n_elem(); const uword n_elem = A.get_n_elem();
eT val1 = eT(0); eT val1 = eT(0);
eT val2 = eT(0); eT val2 = eT(0);
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
val1 += P[i]; val1 += P[i];
val2 += P[j]; val2 += P[j];
skipping to change at line 86 skipping to change at line 86
uword uword
accu(const mtOp<uword,T1,op_rel_noteq>& X) accu(const mtOp<uword,T1,op_rel_noteq>& X)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
const Proxy<T1> A(X.m); const Proxy<T1> A(X.m);
const uword n_elem = A.get_n_elem(); const uword n_elem = A.get_n_elem();
const eT val = X.aux; const eT val = X.aux;
uword n_nonzero = 0; uword n_nonzero = 0;
for(uword i=0; i<n_elem; ++i) for(uword i=0; i<n_elem; ++i)
{ {
if(A[i] != val) if(A[i] != val)
{ {
++n_nonzero; ++n_nonzero;
} }
} }
skipping to change at line 119 skipping to change at line 119
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename ProxyCube<T1>::ea_type ea_type; typedef typename ProxyCube<T1>::ea_type ea_type;
const ProxyCube<T1> A(X.get_ref()); const ProxyCube<T1> A(X.get_ref());
if(ProxyCube<T1>::prefer_at_accessor == false) if(ProxyCube<T1>::prefer_at_accessor == false)
{ {
ea_type P = A.get_ea(); ea_type P = A.get_ea();
const uword n_elem = A.get_n_elem(); const uword n_elem = A.get_n_elem();
eT val1 = eT(0); eT val1 = eT(0);
eT val2 = eT(0); eT val2 = eT(0);
uword i,j; uword i,j;
for(i=0, j=1; j<n_elem; i+=2, j+=2) for(i=0, j=1; j<n_elem; i+=2, j+=2)
{ {
val1 += P[i]; val1 += P[i];
val2 += P[j]; val2 += P[j];
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 injector_bones.hpp   injector_bones.hpp 
skipping to change at line 25 skipping to change at line 25
template<typename eT> template<typename eT>
class mat_injector_row class mat_injector_row
{ {
public: public:
inline mat_injector_row(); inline mat_injector_row();
inline void insert(const eT val) const; inline void insert(const eT val) const;
mutable uword n_cols; mutable uword n_cols;
mutable podarray<eT> A; mutable podarray<eT> A;
mutable podarray<eT> B; mutable podarray<eT> B;
}; };
template<typename T1> template<typename T1>
class mat_injector class mat_injector
{ {
public: public:
typedef typename T1::elem_type elem_type; typedef typename T1::elem_type elem_type;
inline void insert(const elem_type val) const; inline void insert(const elem_type val) const;
inline void end_of_row() const; inline void end_of_row() const;
inline ~mat_injector(); inline ~mat_injector();
private: private:
inline mat_injector(T1& in_X, const elem_type val); inline mat_injector(T1& in_X, const elem_type val);
inline mat_injector(T1& in_X, const injector_end_of_row& x); inline mat_injector(T1& in_X, const injector_end_of_row& x);
T1& X; T1& X;
mutable uword n_rows; mutable uword n_rows;
mutable podarray< mat_injector_row<elem_type>* >* AA; mutable podarray< mat_injector_row<elem_type>* >* AA;
mutable podarray< mat_injector_row<elem_type>* >* BB; mutable podarray< mat_injector_row<elem_type>* >* BB;
friend class Mat<elem_type>; friend class Mat<elem_type>;
friend class Row<elem_type>; friend class Row<elem_type>;
friend class Col<elem_type>; friend class Col<elem_type>;
}; };
skipping to change at line 69 skipping to change at line 69
template<typename oT> template<typename oT>
class field_injector_row class field_injector_row
{ {
public: public:
inline field_injector_row(); inline field_injector_row();
inline ~field_injector_row(); inline ~field_injector_row();
inline void insert(const oT& val) const; inline void insert(const oT& val) const;
mutable uword n_cols; mutable uword n_cols;
mutable field<oT>* AA; mutable field<oT>* AA;
mutable field<oT>* BB; mutable field<oT>* BB;
}; };
template<typename T1> template<typename T1>
class field_injector class field_injector
{ {
public: public:
typedef typename T1::object_type object_type; typedef typename T1::object_type object_type;
inline void insert(const object_type& val) const; inline void insert(const object_type& val) const;
inline void end_of_row() const; inline void end_of_row() const;
inline ~field_injector(); inline ~field_injector();
private: private:
inline field_injector(T1& in_X, const object_type& val); inline field_injector(T1& in_X, const object_type& val);
inline field_injector(T1& in_X, const injector_end_of_row& x); inline field_injector(T1& in_X, const injector_end_of_row& x);
T1& X; T1& X;
mutable uword n_rows; mutable uword n_rows;
mutable podarray< field_injector_row<object_type>* >* AA; mutable podarray< field_injector_row<object_type>* >* AA;
mutable podarray< field_injector_row<object_type>* >* BB; mutable podarray< field_injector_row<object_type>* >* BB;
friend class field<object_type>; friend class field<object_type>;
}; };
//! @} //! @}
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 lapack_bones.hpp   lapack_bones.hpp 
skipping to change at line 201 skipping to change at line 201
#define arma_csytrf CSYTRF #define arma_csytrf CSYTRF
#define arma_zsytrf ZSYTRF #define arma_zsytrf ZSYTRF
#define arma_ssytri SSYTRI #define arma_ssytri SSYTRI
#define arma_dsytri DSYTRI #define arma_dsytri DSYTRI
#define arma_csytri CSYTRI #define arma_csytri CSYTRI
#define arma_zsytri ZSYTRI #define arma_zsytri ZSYTRI
#endif #endif
//! \namespace lapack namespace for LAPACK functions extern "C"
namespace lapack
{ {
//! \addtogroup LAPACK // LU factorisation
//! @{ void arma_fortran(arma_sgetrf)(blas_int* m, blas_int* n, float* a, blas_
int* lda, blas_int* ipiv, blas_int* info);
extern "C" void arma_fortran(arma_dgetrf)(blas_int* m, blas_int* n, double* a, blas_
{ int* lda, blas_int* ipiv, blas_int* info);
// LU factorisation void arma_fortran(arma_cgetrf)(blas_int* m, blas_int* n, void* a, blas_
void arma_fortran(arma_sgetrf)(blas_int* m, blas_int* n, float* a, bla int* lda, blas_int* ipiv, blas_int* info);
s_int* lda, blas_int* ipiv, blas_int* info); void arma_fortran(arma_zgetrf)(blas_int* m, blas_int* n, void* a, blas_
void arma_fortran(arma_dgetrf)(blas_int* m, blas_int* n, double* a, bla int* lda, blas_int* ipiv, blas_int* info);
s_int* lda, blas_int* ipiv, blas_int* info);
void arma_fortran(arma_cgetrf)(blas_int* m, blas_int* n, void* a, bla // matrix inversion (using LU factorisation result)
s_int* lda, blas_int* ipiv, blas_int* info); void arma_fortran(arma_sgetri)(blas_int* n, float* a, blas_int* lda, bla
void arma_fortran(arma_zgetrf)(blas_int* m, blas_int* n, void* a, bla s_int* ipiv, float* work, blas_int* lwork, blas_int* info);
s_int* lda, blas_int* ipiv, blas_int* info); void arma_fortran(arma_dgetri)(blas_int* n, double* a, blas_int* lda, bla
s_int* ipiv, double* work, blas_int* lwork, blas_int* info);
// matrix inversion (using LU factorisation result) void arma_fortran(arma_cgetri)(blas_int* n, void* a, blas_int* lda, bla
void arma_fortran(arma_sgetri)(blas_int* n, float* a, blas_int* lda, b s_int* ipiv, void* work, blas_int* lwork, blas_int* info);
las_int* ipiv, float* work, blas_int* lwork, blas_int* info); void arma_fortran(arma_zgetri)(blas_int* n, void* a, blas_int* lda, bla
void arma_fortran(arma_dgetri)(blas_int* n, double* a, blas_int* lda, b s_int* ipiv, void* work, blas_int* lwork, blas_int* info);
las_int* ipiv, double* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_cgetri)(blas_int* n, void* a, blas_int* lda, b // matrix inversion (triangular matrices)
las_int* ipiv, void* work, blas_int* lwork, blas_int* info); void arma_fortran(arma_strtri)(char* uplo, char* diag, blas_int* n, floa
void arma_fortran(arma_zgetri)(blas_int* n, void* a, blas_int* lda, b t* a, blas_int* lda, blas_int* info);
las_int* ipiv, void* work, blas_int* lwork, blas_int* info); void arma_fortran(arma_dtrtri)(char* uplo, char* diag, blas_int* n, doubl
e* a, blas_int* lda, blas_int* info);
// matrix inversion (triangular matrices) void arma_fortran(arma_ctrtri)(char* uplo, char* diag, blas_int* n, voi
void arma_fortran(arma_strtri)(char* uplo, char* diag, blas_int* n, fl d* a, blas_int* lda, blas_int* info);
oat* a, blas_int* lda, blas_int* info); void arma_fortran(arma_ztrtri)(char* uplo, char* diag, blas_int* n, voi
void arma_fortran(arma_dtrtri)(char* uplo, char* diag, blas_int* n, dou d* a, blas_int* lda, blas_int* info);
ble* a, blas_int* lda, blas_int* info);
void arma_fortran(arma_ctrtri)(char* uplo, char* diag, blas_int* n, v // eigenvector decomposition of symmetric real matrices
oid* a, blas_int* lda, blas_int* info); void arma_fortran(arma_ssyev)(char* jobz, char* uplo, blas_int* n, float
void arma_fortran(arma_ztrtri)(char* uplo, char* diag, blas_int* n, v * a, blas_int* lda, float* w, float* work, blas_int* lwork, blas_int* inf
oid* a, blas_int* lda, blas_int* info); o);
void arma_fortran(arma_dsyev)(char* jobz, char* uplo, blas_int* n, double
// eigenvector decomposition of symmetric real matrices * a, blas_int* lda, double* w, double* work, blas_int* lwork, blas_int* inf
void arma_fortran(arma_ssyev)(char* jobz, char* uplo, blas_int* n, flo o);
at* a, blas_int* lda, float* w, float* work, blas_int* lwork, blas_int* i
nfo); // eigenvector decomposition of hermitian matrices (complex)
void arma_fortran(arma_dsyev)(char* jobz, char* uplo, blas_int* n, doub void arma_fortran(arma_cheev)(char* jobz, char* uplo, blas_int* n, void
le* a, blas_int* lda, double* w, double* work, blas_int* lwork, blas_int* i * a, blas_int* lda, float* w, void* work, blas_int* lwork, float* rwork
nfo); , blas_int* info);
void arma_fortran(arma_zheev)(char* jobz, char* uplo, blas_int* n, void
// eigenvector decomposition of hermitian matrices (complex) * a, blas_int* lda, double* w, void* work, blas_int* lwork, double* rwork
void arma_fortran(arma_cheev)(char* jobz, char* uplo, blas_int* n, vo , blas_int* info);
id* a, blas_int* lda, float* w, void* work, blas_int* lwork, float* rwo
rk, blas_int* info); // eigenvector decomposition of general real matrices
void arma_fortran(arma_zheev)(char* jobz, char* uplo, blas_int* n, vo void arma_fortran(arma_sgeev)(char* jobvl, char* jobvr, blas_int* n, flo
id* a, blas_int* lda, double* w, void* work, blas_int* lwork, double* rwo at* a, blas_int* lda, float* wr, float* wi, float* vl, blas_int* ldvl,
rk, blas_int* info); float* vr, blas_int* ldvr, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_dgeev)(char* jobvl, char* jobvr, blas_int* n, doub
// eigenvector decomposition of general real matrices le* a, blas_int* lda, double* wr, double* wi, double* vl, blas_int* ldvl, d
void arma_fortran(arma_sgeev)(char* jobvl, char* jobvr, blas_int* n, f ouble* vr, blas_int* ldvr, double* work, blas_int* lwork, blas_int* info);
loat* a, blas_int* lda, float* wr, float* wi, float* vl, blas_int* ldvl,
float* vr, blas_int* ldvr, float* work, blas_int* lwork, blas_int* info) // eigenvector decomposition of general complex matrices
; void arma_fortran(arma_cgeev)(char* jobvl, char* jobvr, blas_int* n, void
void arma_fortran(arma_dgeev)(char* jobvl, char* jobvr, blas_int* n, do * a, blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int*
uble* a, blas_int* lda, double* wr, double* wi, double* vl, blas_int* ldvl, ldvr, void* work, blas_int* lwork, float* rwork, blas_int* info);
double* vr, blas_int* ldvr, double* work, blas_int* lwork, blas_int* info) void arma_fortran(arma_zgeev)(char* jobvl, char* jobvr, blas_int* n, void
; * a, blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int*
ldvr, void* work, blas_int* lwork, double* rwork, blas_int* info);
// eigenvector decomposition of general complex matrices
void arma_fortran(arma_cgeev)(char* jobvr, char* jobvl, blas_int* n, vo // Cholesky decomposition
id* a, blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int void arma_fortran(arma_spotrf)(char* uplo, blas_int* n, float* a, blas_i
* ldvr, void* work, blas_int* lwork, float* rwork, blas_int* info); nt* lda, blas_int* info);
void arma_fortran(arma_zgeev)(char* jobvl, char* jobvr, blas_int* n, vo void arma_fortran(arma_dpotrf)(char* uplo, blas_int* n, double* a, blas_i
id* a, blas_int* lda, void* w, void* vl, blas_int* ldvl, void* vr, blas_int nt* lda, blas_int* info);
* ldvr, void* work, blas_int* lwork, double* rwork, blas_int* info); void arma_fortran(arma_cpotrf)(char* uplo, blas_int* n, void* a, blas_i
nt* lda, blas_int* info);
// Cholesky decomposition void arma_fortran(arma_zpotrf)(char* uplo, blas_int* n, void* a, blas_i
void arma_fortran(arma_spotrf)(char* uplo, blas_int* n, float* a, blas nt* lda, blas_int* info);
_int* lda, blas_int* info);
void arma_fortran(arma_dpotrf)(char* uplo, blas_int* n, double* a, blas // matrix inversion (using Cholesky decomposition result)
_int* lda, blas_int* info); void arma_fortran(arma_spotri)(char* uplo, blas_int* n, float* a, blas_i
void arma_fortran(arma_cpotrf)(char* uplo, blas_int* n, void* a, blas nt* lda, blas_int* info);
_int* lda, blas_int* info); void arma_fortran(arma_dpotri)(char* uplo, blas_int* n, double* a, blas_i
void arma_fortran(arma_zpotrf)(char* uplo, blas_int* n, void* a, blas nt* lda, blas_int* info);
_int* lda, blas_int* info); void arma_fortran(arma_cpotri)(char* uplo, blas_int* n, void* a, blas_i
nt* lda, blas_int* info);
// matrix inversion (using Cholesky decomposition result) void arma_fortran(arma_zpotri)(char* uplo, blas_int* n, void* a, blas_i
void arma_fortran(arma_spotri)(char* uplo, blas_int* n, float* a, blas nt* lda, blas_int* info);
_int* lda, blas_int* info);
void arma_fortran(arma_dpotri)(char* uplo, blas_int* n, double* a, blas // QR decomposition
_int* lda, blas_int* info); void arma_fortran(arma_sgeqrf)(blas_int* m, blas_int* n, float* a, blas_
void arma_fortran(arma_cpotri)(char* uplo, blas_int* n, void* a, blas int* lda, float* tau, float* work, blas_int* lwork, blas_int* info);
_int* lda, blas_int* info); void arma_fortran(arma_dgeqrf)(blas_int* m, blas_int* n, double* a, blas_
void arma_fortran(arma_zpotri)(char* uplo, blas_int* n, void* a, blas int* lda, double* tau, double* work, blas_int* lwork, blas_int* info);
_int* lda, blas_int* info); void arma_fortran(arma_cgeqrf)(blas_int* m, blas_int* n, void* a, blas_
int* lda, void* tau, void* work, blas_int* lwork, blas_int* info);
// QR decomposition void arma_fortran(arma_zgeqrf)(blas_int* m, blas_int* n, void* a, blas_
void arma_fortran(arma_sgeqrf)(blas_int* m, blas_int* n, float* a, bla int* lda, void* tau, void* work, blas_int* lwork, blas_int* info);
s_int* lda, float* tau, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_dgeqrf)(blas_int* m, blas_int* n, double* a, bla // Q matrix calculation from QR decomposition (real matrices)
s_int* lda, double* tau, double* work, blas_int* lwork, blas_int* info); void arma_fortran(arma_sorgqr)(blas_int* m, blas_int* n, blas_int* k, fl
void arma_fortran(arma_cgeqrf)(blas_int* m, blas_int* n, void* a, bla oat* a, blas_int* lda, float* tau, float* work, blas_int* lwork, blas_int
s_int* lda, void* tau, void* work, blas_int* lwork, blas_int* info); * info);
void arma_fortran(arma_zgeqrf)(blas_int* m, blas_int* n, void* a, bla void arma_fortran(arma_dorgqr)(blas_int* m, blas_int* n, blas_int* k, dou
s_int* lda, void* tau, void* work, blas_int* lwork, blas_int* info); ble* a, blas_int* lda, double* tau, double* work, blas_int* lwork, blas_int
* info);
// Q matrix calculation from QR decomposition (real matrices)
void arma_fortran(arma_sorgqr)(blas_int* m, blas_int* n, blas_int* k, // Q matrix calculation from QR decomposition (complex matrices)
float* a, blas_int* lda, float* tau, float* work, blas_int* lwork, blas_i void arma_fortran(arma_cungqr)(blas_int* m, blas_int* n, blas_int* k, v
nt* info); oid* a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_int
void arma_fortran(arma_dorgqr)(blas_int* m, blas_int* n, blas_int* k, d * info);
ouble* a, blas_int* lda, double* tau, double* work, blas_int* lwork, blas_i void arma_fortran(arma_zungqr)(blas_int* m, blas_int* n, blas_int* k, v
nt* info); oid* a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_int
* info);
// Q matrix calculation from QR decomposition (complex matrices)
void arma_fortran(arma_cungqr)(blas_int* m, blas_int* n, blas_int* k, // SVD (real matrices)
void* a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_i void arma_fortran(arma_sgesvd)(char* jobu, char* jobvt, blas_int* m, blas
nt* info); _int* n, float* a, blas_int* lda, float* s, float* u, blas_int* ldu, flo
void arma_fortran(arma_zungqr)(blas_int* m, blas_int* n, blas_int* k, at* vt, blas_int* ldvt, float* work, blas_int* lwork, blas_int* info);
void* a, blas_int* lda, void* tau, void* work, blas_int* lwork, blas_i void arma_fortran(arma_dgesvd)(char* jobu, char* jobvt, blas_int* m, blas
nt* info); _int* n, double* a, blas_int* lda, double* s, double* u, blas_int* ldu, dou
ble* vt, blas_int* ldvt, double* work, blas_int* lwork, blas_int* info);
// SVD (real matrices)
void arma_fortran(arma_sgesvd)(char* jobu, char* jobvt, blas_int* m, bl // SVD (complex matrices)
as_int* n, float* a, blas_int* lda, float* s, float* u, blas_int* ldu, f void arma_fortran(arma_cgesvd)(char* jobu, char* jobvt, blas_int* m, blas
loat* vt, blas_int* ldvt, float* work, blas_int* lwork, blas_int* info); _int* n, void* a, blas_int* lda, float* s, void* u, blas_int* ldu, voi
void arma_fortran(arma_dgesvd)(char* jobu, char* jobvt, blas_int* m, bl d* vt, blas_int* ldvt, void* work, blas_int* lwork, float* rwork, blas
as_int* n, double* a, blas_int* lda, double* s, double* u, blas_int* ldu, d _int* info);
ouble* vt, blas_int* ldvt, double* work, blas_int* lwork, blas_int* info); void arma_fortran(arma_zgesvd)(char* jobu, char* jobvt, blas_int* m, blas
_int* n, void* a, blas_int* lda, double* s, void* u, blas_int* ldu, voi
// SVD (complex matrices) d* vt, blas_int* ldvt, void* work, blas_int* lwork, double* rwork, blas
void arma_fortran(arma_cgesvd)(char* jobu, char* jobvt, blas_int* m, bl _int* info);
as_int* n, void* a, blas_int* lda, float* s, void* u, blas_int* ldu, v
oid* vt, blas_int* ldvt, void* work, blas_int* lwork, float* rwork, bl // solve system of linear equations, using LU decomposition
as_int* info); void arma_fortran(arma_sgesv)(blas_int* n, blas_int* nrhs, float* a, bla
void arma_fortran(arma_zgesvd)(char* jobu, char* jobvt, blas_int* m, bl s_int* lda, blas_int* ipiv, float* b, blas_int* ldb, blas_int* info);
as_int* n, void* a, blas_int* lda, double* s, void* u, blas_int* ldu, v void arma_fortran(arma_dgesv)(blas_int* n, blas_int* nrhs, double* a, bla
oid* vt, blas_int* ldvt, void* work, blas_int* lwork, double* rwork, bl s_int* lda, blas_int* ipiv, double* b, blas_int* ldb, blas_int* info);
as_int* info); void arma_fortran(arma_cgesv)(blas_int* n, blas_int* nrhs, void* a, bla
s_int* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info);
// solve system of linear equations, using LU decomposition void arma_fortran(arma_zgesv)(blas_int* n, blas_int* nrhs, void* a, bla
void arma_fortran(arma_sgesv)(blas_int* n, blas_int* nrhs, float* a, b s_int* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info);
las_int* lda, blas_int* ipiv, float* b, blas_int* ldb, blas_int* info);
void arma_fortran(arma_dgesv)(blas_int* n, blas_int* nrhs, double* a, b // solve over/underdetermined system of linear equations
las_int* lda, blas_int* ipiv, double* b, blas_int* ldb, blas_int* info); void arma_fortran(arma_sgels)(char* trans, blas_int* m, blas_int* n, blas
void arma_fortran(arma_cgesv)(blas_int* n, blas_int* nrhs, void* a, b _int* nrhs, float* a, blas_int* lda, float* b, blas_int* ldb, float* wor
las_int* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info); k, blas_int* lwork, blas_int* info);
void arma_fortran(arma_zgesv)(blas_int* n, blas_int* nrhs, void* a, b void arma_fortran(arma_dgels)(char* trans, blas_int* m, blas_int* n, blas
las_int* lda, blas_int* ipiv, void* b, blas_int* ldb, blas_int* info); _int* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, double* wor
k, blas_int* lwork, blas_int* info);
// solve over/underdetermined system of linear equations void arma_fortran(arma_cgels)(char* trans, blas_int* m, blas_int* n, blas
void arma_fortran(arma_sgels)(char* trans, blas_int* m, blas_int* n, bl _int* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* wor
as_int* nrhs, float* a, blas_int* lda, float* b, blas_int* ldb, float* w k, blas_int* lwork, blas_int* info);
ork, blas_int* lwork, blas_int* info); void arma_fortran(arma_zgels)(char* trans, blas_int* m, blas_int* n, blas
void arma_fortran(arma_dgels)(char* trans, blas_int* m, blas_int* n, bl _int* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* wor
as_int* nrhs, double* a, blas_int* lda, double* b, blas_int* ldb, double* w k, blas_int* lwork, blas_int* info);
ork, blas_int* lwork, blas_int* info);
void arma_fortran(arma_cgels)(char* trans, blas_int* m, blas_int* n, bl // solve a triangular system of linear equations
as_int* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* w void arma_fortran(arma_strtrs)(char* uplo, char* trans, char* diag, blas_
ork, blas_int* lwork, blas_int* info); int* n, blas_int* nrhs, const float* a, blas_int* lda, float* b, blas_int
void arma_fortran(arma_zgels)(char* trans, blas_int* m, blas_int* n, bl * ldb, blas_int* info);
as_int* nrhs, void* a, blas_int* lda, void* b, blas_int* ldb, void* w void arma_fortran(arma_dtrtrs)(char* uplo, char* trans, char* diag, blas_
ork, blas_int* lwork, blas_int* info); int* n, blas_int* nrhs, const double* a, blas_int* lda, double* b, blas_int
* ldb, blas_int* info);
// solve a triangular system of linear equations void arma_fortran(arma_ctrtrs)(char* uplo, char* trans, char* diag, blas_
void arma_fortran(arma_strtrs)(char* uplo, char* trans, char* diag, bla int* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_int
s_int* n, blas_int* nrhs, const float* a, blas_int* lda, float* b, blas_i * ldb, blas_int* info);
nt* ldb, blas_int* info); void arma_fortran(arma_ztrtrs)(char* uplo, char* trans, char* diag, blas_
void arma_fortran(arma_dtrtrs)(char* uplo, char* trans, char* diag, bla int* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_int
s_int* n, blas_int* nrhs, const double* a, blas_int* lda, double* b, blas_i * ldb, blas_int* info);
nt* ldb, blas_int* info);
void arma_fortran(arma_ctrtrs)(char* uplo, char* trans, char* diag, bla // Schur decomposition (real matrices)
s_int* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_i void arma_fortran(arma_sgees)(char* jobvs, char* sort, blas_int* select,
nt* ldb, blas_int* info); blas_int* n, float* a, blas_int* lda, blas_int* sdim, float* wr, float*
void arma_fortran(arma_ztrtrs)(char* uplo, char* trans, char* diag, bla wi, float* vs, blas_int* ldvs, float* work, blas_int* lwork, blas_int* bw
s_int* n, blas_int* nrhs, const void* a, blas_int* lda, void* b, blas_i ork, blas_int* info);
nt* ldb, blas_int* info); void arma_fortran(arma_dgees)(char* jobvs, char* sort, blas_int* select,
blas_int* n, double* a, blas_int* lda, blas_int* sdim, double* wr, double*
// Schur decomposition (real matrices) wi, double* vs, blas_int* ldvs, double* work, blas_int* lwork, blas_int* bw
void arma_fortran(arma_sgees)(char* jobvs, char* sort, blas_int* select ork, blas_int* info);
, blas_int* n, float* a, blas_int* lda, blas_int* sdim, float* wr, float*
wi, float* vs, blas_int* ldvs, float* work, blas_int* lwork, blas_int* // Schur decomposition (complex matrices)
bwork, blas_int* info); void arma_fortran(arma_cgees)(char* jobvs, char* sort, blas_int* select,
void arma_fortran(arma_dgees)(char* jobvs, char* sort, blas_int* select blas_int* n, void* a, blas_int* lda, blas_int* sdim, void* w, void* vs, bla
, blas_int* n, double* a, blas_int* lda, blas_int* sdim, double* wr, double s_int* ldvs, void* work, blas_int* lwork, float* rwork, blas_int* bwork, b
* wi, double* vs, blas_int* ldvs, double* work, blas_int* lwork, blas_int* las_int* info);
bwork, blas_int* info); void arma_fortran(arma_zgees)(char* jobvs, char* sort, blas_int* select,
blas_int* n, void* a, blas_int* lda, blas_int* sdim, void* w, void* vs, bla
// Schur decomposition (complex matrices) s_int* ldvs, void* work, blas_int* lwork, double* rwork, blas_int* bwork, b
void arma_fortran(arma_cgees)(char* jobvs, char* sort, blas_int* select las_int* info);
, blas_int* n, void* a, blas_int* lda, blas_int* sdim, void* w, void* vs, b
las_int* ldvs, void* work, blas_int* lwork, float* rwork, blas_int* bwork, // solve a Sylvester equation ax + xb = c, with a and b assumed to be in
blas_int* info); Schur form
void arma_fortran(arma_zgees)(char* jobvs, char* sort, blas_int* select void arma_fortran(arma_strsyl)(char* transa, char* transb, blas_int* isgn
, blas_int* n, void* a, blas_int* lda, blas_int* sdim, void* w, void* vs, b , blas_int* m, blas_int* n, const float* a, blas_int* lda, const float* b
las_int* ldvs, void* work, blas_int* lwork, double* rwork, blas_int* bwork, , blas_int* ldb, float* c, blas_int* ldc, float* scale, blas_int* info);
blas_int* info); void arma_fortran(arma_dtrsyl)(char* transa, char* transb, blas_int* isgn
, blas_int* m, blas_int* n, const double* a, blas_int* lda, const double* b
// solve a Sylvester equation ax + xb = c, with a and b assumed to be i , blas_int* ldb, double* c, blas_int* ldc, double* scale, blas_int* info);
n Schur form void arma_fortran(arma_ctrsyl)(char* transa, char* transb, blas_int* isgn
void arma_fortran(arma_strsyl)(char* transa, char* transb, blas_int* is , blas_int* m, blas_int* n, const void* a, blas_int* lda, const void* b
gn, blas_int* m, blas_int* n, const float* a, blas_int* lda, const float* , blas_int* ldb, void* c, blas_int* ldc, float* scale, blas_int* info);
b, blas_int* ldb, float* c, blas_int* ldc, float* scale, blas_int* info) void arma_fortran(arma_ztrsyl)(char* transa, char* transb, blas_int* isgn
; , blas_int* m, blas_int* n, const void* a, blas_int* lda, const void* b
void arma_fortran(arma_dtrsyl)(char* transa, char* transb, blas_int* is , blas_int* ldb, void* c, blas_int* ldc, double* scale, blas_int* info);
gn, blas_int* m, blas_int* n, const double* a, blas_int* lda, const double*
b, blas_int* ldb, double* c, blas_int* ldc, double* scale, blas_int* info) void arma_fortran(arma_ssytrf)(char* uplo, blas_int* n, float* a, blas_i
; nt* lda, blas_int* ipiv, float* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_ctrsyl)(char* transa, char* transb, blas_int* is void arma_fortran(arma_dsytrf)(char* uplo, blas_int* n, double* a, blas_i
gn, blas_int* m, blas_int* n, const void* a, blas_int* lda, const void* nt* lda, blas_int* ipiv, double* work, blas_int* lwork, blas_int* info);
b, blas_int* ldb, void* c, blas_int* ldc, float* scale, blas_int* info) void arma_fortran(arma_csytrf)(char* uplo, blas_int* n, void* a, blas_i
; nt* lda, blas_int* ipiv, void* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_ztrsyl)(char* transa, char* transb, blas_int* is void arma_fortran(arma_zsytrf)(char* uplo, blas_int* n, void* a, blas_i
gn, blas_int* m, blas_int* n, const void* a, blas_int* lda, const void* nt* lda, blas_int* ipiv, void* work, blas_int* lwork, blas_int* info);
b, blas_int* ldb, void* c, blas_int* ldc, double* scale, blas_int* info)
; void arma_fortran(arma_ssytri)(char* uplo, blas_int* n, float* a, blas_i
nt* lda, blas_int* ipiv, float* work, blas_int* info);
void arma_fortran(arma_ssytrf)(char* uplo, blas_int* n, float* a, blas void arma_fortran(arma_dsytri)(char* uplo, blas_int* n, double* a, blas_i
_int* lda, blas_int* ipiv, float* work, blas_int* lwork, blas_int* info); nt* lda, blas_int* ipiv, double* work, blas_int* info);
void arma_fortran(arma_dsytrf)(char* uplo, blas_int* n, double* a, blas void arma_fortran(arma_csytri)(char* uplo, blas_int* n, void* a, blas_i
_int* lda, blas_int* ipiv, double* work, blas_int* lwork, blas_int* info); nt* lda, blas_int* ipiv, void* work, blas_int* info);
void arma_fortran(arma_csytrf)(char* uplo, blas_int* n, void* a, blas void arma_fortran(arma_zsytri)(char* uplo, blas_int* n, void* a, blas_i
_int* lda, blas_int* ipiv, void* work, blas_int* lwork, blas_int* info); nt* lda, blas_int* ipiv, void* work, blas_int* info);
void arma_fortran(arma_zsytrf)(char* uplo, blas_int* n, void* a, blas
_int* lda, blas_int* ipiv, void* work, blas_int* lwork, blas_int* info); // void arma_fortran(arma_dgeqp3)(blas_int* m, blas_int* n, double* a, bl
as_int* lda, blas_int* jpvt, double* tau, double* work, blas_int* lwork, bl
void arma_fortran(arma_ssytri)(char* uplo, blas_int* n, float* a, blas as_int* info);
_int* lda, blas_int* ipiv, float* work, blas_int* info); // void arma_fortran(arma_dormqr)(char* side, char* trans, blas_int* m, b
void arma_fortran(arma_dsytri)(char* uplo, blas_int* n, double* a, blas las_int* n, blas_int* k, double* a, blas_int* lda, double* tau, double* c,
_int* lda, blas_int* ipiv, double* work, blas_int* info); blas_int* ldc, double* work, blas_int* lwork, blas_int* info);
void arma_fortran(arma_csytri)(char* uplo, blas_int* n, void* a, blas // void arma_fortran(arma_dposv)(char* uplo, blas_int* n, blas_int* nrhs
_int* lda, blas_int* ipiv, void* work, blas_int* info); , double* a, blas_int* lda, double* b, blas_int* ldb, blas_int* info);
void arma_fortran(arma_zsytri)(char* uplo, blas_int* n, void* a, blas
_int* lda, blas_int* ipiv, void* work, blas_int* info);
// void arma_fortran(arma_dgeqp3)(blas_int* m, blas_int* n, double* a,
blas_int* lda, blas_int* jpvt, double* tau, double* work, blas_int* lwork,
blas_int* info);
// void arma_fortran(arma_dormqr)(char* side, char* trans, blas_int* m,
blas_int* n, blas_int* k, double* a, blas_int* lda, double* tau, double* c
, blas_int* ldc, double* work, blas_int* lwork, blas_int* info);
// void arma_fortran(arma_dposv)(char* uplo, blas_int* n, blas_int* nr
hs, double* a, blas_int* lda, double* b, blas_int* ldb, blas_int* info);
}
template<typename eT>
inline
void
getrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, bla
s_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgetrf)(m, n, (T*)a, lda, ipiv, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgetrf)(m, n, (T*)a, lda, ipiv, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgetrf)(m, n, (T*)a, lda, ipiv, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgetrf)(m, n, (T*)a, lda, ipiv, info);
}
}
template<typename eT>
inline
void
getri(blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT* work, blas_
int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info)
;
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info)
;
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info)
;
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgetri)(n, (T*)a, lda, ipiv, (T*)work, lwork, info)
;
}
}
template<typename eT>
inline
void
trtri(char* uplo, char* diag, blas_int* n, eT* a, blas_int* lda, blas_int
* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_strtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dtrtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_ctrtri)(uplo, diag, n, (T*)a, lda, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_ztrtri)(uplo, diag, n, (T*)a, lda, info);
}
}
template<typename eT>
inline
void
syev(char* jobz, char* uplo, blas_int* n, eT* a, blas_int* lda, eT* w, e
T* work, blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_ssyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work,
lwork, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dsyev)(jobz, uplo, n, (T*)a, lda, (T*)w, (T*)work,
lwork, info);
}
}
template<typename eT>
inline
void
heev
(
char* jobz, char* uplo, blas_int* n,
eT* a, blas_int* lda, typename eT::value_type* w,
eT* work, blas_int* lwork, typename eT::value_type* rwork,
blas_int* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_supported_complex_float<eT>::value == true)
{
typedef float T;
typedef typename std::complex<T> cx_T;
arma_fortran(arma_cheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)
work, lwork, (T*)rwork, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef double T;
typedef typename std::complex<T> cx_T;
arma_fortran(arma_zheev)(jobz, uplo, n, (cx_T*)a, lda, (T*)w, (cx_T*)
work, lwork, (T*)rwork, info);
}
}
template<typename eT>
inline
void
geev
(
char* jobvl, char* jobvr, blas_int* n,
eT* a, blas_int* lda, eT* wr, eT* wi, eT* vl,
blas_int* ldvl, eT* vr, blas_int* ldvr,
eT* work, blas_int* lwork,
blas_int* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi
, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgeev)(jobvl, jobvr, n, (T*)a, lda, (T*)wr, (T*)wi
, (T*)vl, ldvl, (T*)vr, ldvr, (T*)work, lwork, info);
}
}
template<typename eT>
inline
void
cx_geev
(
char* jobvl, char* jobvr, blas_int* n,
eT* a, blas_int* lda, eT* w,
eT* vl, blas_int* ldvl,
eT* vr, blas_int* ldvr,
eT* work, blas_int* lwork, typename eT::value_type* rwork,
blas_int* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_supported_complex_float<eT>::value == true)
{
typedef float T;
typedef typename std::complex<T> cx_T;
arma_fortran(arma_cgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (c
x_T*)vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef double T;
typedef typename std::complex<T> cx_T;
arma_fortran(arma_zgeev)(jobvl, jobvr, n, (cx_T*)a, lda, (cx_T*)w, (c
x_T*)vl, ldvl, (cx_T*)vr, ldvr, (cx_T*)work, lwork, (T*)rwork, info);
}
}
template<typename eT>
inline
void
potrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_spotrf)(uplo, n, (T*)a, lda, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dpotrf)(uplo, n, (T*)a, lda, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cpotrf)(uplo, n, (T*)a, lda, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zpotrf)(uplo, n, (T*)a, lda, info);
}
}
template<typename eT>
inline
void
potri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_spotri)(uplo, n, (T*)a, lda, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dpotri)(uplo, n, (T*)a, lda, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cpotri)(uplo, n, (T*)a, lda, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zpotri)(uplo, n, (T*)a, lda, info);
}
}
template<typename eT>
inline
void
geqrf(blas_int* m, blas_int* n, eT* a, blas_int* lda, eT* tau, eT* work,
blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork,
info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork,
info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork,
info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgeqrf)(m, n, (T*)a, lda, (T*)tau, (T*)work, lwork,
info);
}
}
template<typename eT>
inline
void
orgqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* ta
u, eT* work, blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwo
rk, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dorgqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwo
rk, info);
}
}
template<typename eT>
inline
void
ungqr(blas_int* m, blas_int* n, blas_int* k, eT* a, blas_int* lda, eT* ta
u, eT* work, blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_supported_complex_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_cungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwo
rk, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_zungqr)(m, n, k, (T*)a, lda, (T*)tau, (T*)work, lwo
rk, info);
}
}
template<typename eT>
inline
void
gesvd
(
char* jobu, char* jobvt, blas_int* m, blas_int* n, eT* a, blas_int* lda
,
eT* s, eT* u, blas_int* ldu, eT* vt, blas_int* ldvt,
eT* work, blas_int* lwork, blas_int* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u
, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgesvd)(jobu, jobvt, m, n, (T*)a, lda, (T*)s, (T*)u
, ldu, (T*)vt, ldvt, (T*)work, lwork, info);
}
}
template<typename T>
inline
void
cx_gesvd
(
char* jobu, char* jobvt, blas_int* m, blas_int* n, std::complex<T>* a,
blas_int* lda,
T* s, std::complex<T>* u, blas_int* ldu, std::complex<T>* vt, blas_int*
ldvt,
std::complex<T>* work, blas_int* lwork, T* rwork, blas_int* info
)
{
arma_type_check(( is_supported_blas_type<T>::value == false ));
arma_type_check(( is_supported_blas_type< std::complex<T> >::value == f
alse ));
if(is_float<T>::value == true)
{
typedef float bT;
arma_fortran(arma_cgesvd)
(
jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
(bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
(std::complex<bT>*)work, lwork, (bT*)rwork, info
);
}
else
if(is_double<T>::value == true)
{
typedef double bT;
arma_fortran(arma_zgesvd)
(
jobu, jobvt, m, n, (std::complex<bT>*)a, lda,
(bT*)s, (std::complex<bT>*)u, ldu, (std::complex<bT>*)vt, ldvt,
(std::complex<bT>*)work, lwork, (bT*)rwork, info
);
}
}
template<typename eT>
inline
void
gesv(blas_int* n, blas_int* nrhs, eT* a, blas_int* lda, blas_int* ipiv, e
T* b, blas_int* ldb, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info)
;
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info)
;
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info)
;
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgesv)(n, nrhs, (T*)a, lda, ipiv, (T*)b, ldb, info)
;
}
}
template<typename eT>
inline
void
gels(char* trans, blas_int* m, blas_int* n, blas_int* nrhs, eT* a, blas_i
nt* lda, eT* b, blas_int* ldb, eT* work, blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_sgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (
T*)work, lwork, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (
T*)work, lwork, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_cgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (
T*)work, lwork, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zgels)(trans, m, n, nrhs, (T*)a, lda, (T*)b, ldb, (
T*)work, lwork, info);
}
}
template<typename eT>
inline
void
trtrs(char* uplo, char* trans, char* diag, blas_int* n, blas_int* nrhs, c
onst eT* a, blas_int* lda, eT* b, blas_int* ldb, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_strtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*
)b, ldb, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dtrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*
)b, ldb, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_ctrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*
)b, ldb, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_ztrtrs)(uplo, trans, diag, n, nrhs, (T*)a, lda, (T*
)b, ldb, info);
}
}
template<typename eT>
inline
void
gees(char* jobvs, char* sort, blas_int* select, blas_int* n, eT* a, blas_
int* lda, blas_int* sdim, eT* wr, eT* wi, eT* vs, blas_int* ldvs, eT* work,
blas_int* lwork, blas_int* bwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(sgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr,
(T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(dgees)(jobvs, sort, select, n, (T*)a, lda, sdim, (T*)wr,
(T*)wi, (T*)vs, ldvs, (T*)work, lwork, bwork, info);
}
}
template<typename T>
inline
void
cx_gees(char* jobvs, char* sort, blas_int* select, blas_int* n, std::comp
lex<T>* a, blas_int* lda, blas_int* sdim, std::complex<T>* w, std::complex<
T>* vs, blas_int* ldvs, std::complex<T>* work, blas_int* lwork, T* rwork, b
las_int* bwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<T>::value == false ));
arma_type_check(( is_supported_blas_type< std::complex<T> >::value == f
alse ));
if(is_float<T>::value == true)
{
typedef float bT;
typedef std::complex<bT> cT;
arma_fortran(cgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w
, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
}
else
if(is_double<T>::value == true)
{
typedef double bT;
typedef std::complex<bT> cT;
arma_fortran(zgees)(jobvs, sort, select, n, (cT*)a, lda, sdim, (cT*)w
, (cT*)vs, ldvs, (cT*)work, lwork, (bT*)rwork, bwork, info);
}
}
template<typename eT>
inline
void
trsyl(char* transa, char* transb, blas_int* isgn, blas_int* m, blas_int*
n, const eT* a, blas_int* lda, const eT* b, blas_int* ldb, eT* c, blas_int*
ldc, eT* scale, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(strsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, l
db, (T*)c, ldc, (T*)scale, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(dtrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, l
db, (T*)c, ldc, (T*)scale, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(ctrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, l
db, (T*)c, ldc, (float*)scale, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(ztrsyl)(transa, transb, isgn, m, n, (T*)a, lda, (T*)b, l
db, (T*)c, ldc, (double*)scale, info);
}
}
template<typename eT>
inline
void
sytrf(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT*
work, blas_int* lwork, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_ssytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork,
info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork,
info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_csytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork,
info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zsytrf)(uplo, n, (T*)a, lda, ipiv, (T*)work, lwork,
info);
}
}
template<typename eT>
inline
void
sytri(char* uplo, blas_int* n, eT* a, blas_int* lda, blas_int* ipiv, eT*
work, blas_int* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
if(is_float<eT>::value == true)
{
typedef float T;
arma_fortran(arma_ssytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
}
else
if(is_double<eT>::value == true)
{
typedef double T;
arma_fortran(arma_dsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
}
else
if(is_supported_complex_float<eT>::value == true)
{
typedef std::complex<float> T;
arma_fortran(arma_csytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
}
else
if(is_supported_complex_double<eT>::value == true)
{
typedef std::complex<double> T;
arma_fortran(arma_zsytri)(uplo, n, (T*)a, lda, ipiv, (T*)work, info);
}
}
//! @}
} }
#endif #endif
 End of changes. 2 change blocks. 
947 lines changed or deleted 226 lines changed or added


 mtGlueCube_bones.hpp   mtGlueCube_bones.hpp 
skipping to change at line 28 skipping to change at line 28
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
arma_inline mtGlueCube(const T1& in_A, const T2& in_B); arma_inline mtGlueCube(const T1& in_A, const T2& in_B);
arma_inline mtGlueCube(const T1& in_A, const T2& in_B, const uword in_au x_uword); arma_inline mtGlueCube(const T1& in_A, const T2& in_B, const uword in_au x_uword);
arma_inline ~mtGlueCube(); arma_inline ~mtGlueCube();
arma_aligned const T1& A; //!< first operand arma_aligned const T1& A; //!< first operand
arma_aligned const T2& B; //!< second operand arma_aligned const T2& B; //!< second operand
arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format
}; };
//! @} //! @}
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 mtGlue_bones.hpp   mtGlue_bones.hpp 
skipping to change at line 28 skipping to change at line 28
{ {
public: public:
typedef out_eT elem_type; typedef out_eT elem_type;
typedef typename get_pod_type<out_eT>::result pod_type; typedef typename get_pod_type<out_eT>::result pod_type;
arma_inline mtGlue(const T1& in_A, const T2& in_B); arma_inline mtGlue(const T1& in_A, const T2& in_B);
arma_inline mtGlue(const T1& in_A, const T2& in_B, const uword in_aux_uw ord); arma_inline mtGlue(const T1& in_A, const T2& in_B, const uword in_aux_uw ord);
arma_inline ~mtGlue(); arma_inline ~mtGlue();
arma_aligned const T1& A; //!< first operand arma_aligned const T1& A; //!< first operand
arma_aligned const T2& B; //!< second operand arma_aligned const T2& B; //!< second operand
arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format arma_aligned uword aux_uword; //!< storage of auxiliary data, uword format
}; };
//! @} //! @}
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 op_dot_meat.hpp   op_dot_meat.hpp 
skipping to change at line 198 skipping to change at line 198
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
const Proxy<T2> B(Y.get_ref()); const Proxy<T2> B(Y.get_ref());
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor) && (Proxy <T2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor) && (Proxy <T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "dot(): objects m ust have the same number of elements" ); arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "dot(): objects m ust have the same number of elements" );
const uword N = A.get_n_elem(); const uword N = A.get_n_elem();
ea_type1 PA = A.get_ea(); ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea(); ea_type2 PB = B.get_ea();
eT val1 = eT(0); eT val1 = eT(0);
eT val2 = eT(0); eT val2 = eT(0);
uword i,j; uword i,j;
for(i=0, j=1; j<N; i+=2, j+=2) for(i=0, j=1; j<N; i+=2, j+=2)
{ {
skipping to change at line 250 skipping to change at line 250
const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor) && (Proxy <T2>::prefer_at_accessor); const bool prefer_at_accessor = (Proxy<T1>::prefer_at_accessor) && (Proxy <T2>::prefer_at_accessor);
if(prefer_at_accessor == false) if(prefer_at_accessor == false)
{ {
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
const Proxy<T2> B(Y.get_ref()); const Proxy<T2> B(Y.get_ref());
arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "norm_dot(): obje cts must have the same number of elements" ); arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "norm_dot(): obje cts must have the same number of elements" );
const uword N = A.get_n_elem(); const uword N = A.get_n_elem();
ea_type1 PA = A.get_ea(); ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea(); ea_type2 PB = B.get_ea();
eT acc1 = eT(0); eT acc1 = eT(0);
eT acc2 = eT(0); eT acc2 = eT(0);
eT acc3 = eT(0); eT acc3 = eT(0);
for(uword i=0; i<N; ++i) for(uword i=0; i<N; ++i)
{ {
const eT tmpA = PA[i]; const eT tmpA = PA[i];
skipping to change at line 336 skipping to change at line 336
typedef typename T1::elem_type eT; typedef typename T1::elem_type eT;
typedef typename Proxy<T1>::ea_type ea_type1; typedef typename Proxy<T1>::ea_type ea_type1;
typedef typename Proxy<T2>::ea_type ea_type2; typedef typename Proxy<T2>::ea_type ea_type2;
const Proxy<T1> A(X.get_ref()); const Proxy<T1> A(X.get_ref());
const Proxy<T2> B(Y.get_ref()); const Proxy<T2> B(Y.get_ref());
arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "cdot(): objects mu st have the same number of elements" ); arma_debug_check( (A.get_n_elem() != B.get_n_elem()), "cdot(): objects mu st have the same number of elements" );
const uword N = A.get_n_elem(); const uword N = A.get_n_elem();
ea_type1 PA = A.get_ea(); ea_type1 PA = A.get_ea();
ea_type2 PB = B.get_ea(); ea_type2 PB = B.get_ea();
eT val1 = eT(0); eT val1 = eT(0);
eT val2 = eT(0); eT val2 = eT(0);
uword i,j; uword i,j;
for(i=0, j=1; j<N; i+=2, j+=2) for(i=0, j=1; j<N; i+=2, j+=2)
{ {
val1 += std::conj(PA[i]) * PB[i]; val1 += std::conj(PA[i]) * PB[i];
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 op_pinv_bones.hpp   op_pinv_bones.hpp 
// Copyright (C) 2009-2010 NICTA (www.nicta.com.au) // Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
// Copyright (C) 2009-2010 Conrad Sanderson // Copyright (C) 2009-2011 Conrad Sanderson
// Copyright (C) 2009-2010 Dimitrios Bouzas // Copyright (C) 2009-2010 Dimitrios Bouzas
// //
// This file is part of the Armadillo C++ library. // This file is part of the Armadillo C++ library.
// It is provided without any warranty of fitness // It is provided without any warranty of fitness
// for any purpose. You can redistribute this file // for any purpose. You can redistribute this file
// and/or modify it under the terms of the GNU // and/or modify it under the terms of the GNU
// Lesser General Public License (LGPL) as published // Lesser General Public License (LGPL) as published
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_pinv //! \addtogroup op_pinv
//! @{ //! @{
class op_pinv class op_pinv
{ {
public: public:
template<typename eT> inline static void direct_pinv(Mat<eT>& template<typename eT> inline static void direct_pinv(Mat<eT>& out, const
out, const Mat<eT>& X, eT tol); Mat<eT>& A, const eT in_tol);
template<typename eT> inline static void direct_pinv(Mat< std::complex<eT
> >& out, const Mat< std::complex<eT> >& X, eT tol);
template<typename T1> inline static void apply(Mat<typename T1::pod_type> template<typename T1> inline static void apply(Mat<typename T1::elem_type
& out, const Op<T1,op_pinv>& in); >& out, const Op<T1,op_pinv>& in);
template<typename T1> inline static void apply(Mat< std::complex<typename
T1::pod_type> >& out, const Op<T1,op_pinv>& in);
}; };
//! @} //! @}
 End of changes. 3 change blocks. 
10 lines changed or deleted 6 lines changed or added


 op_pinv_meat.hpp   op_pinv_meat.hpp 
skipping to change at line 21 skipping to change at line 21
// by the Free Software Foundation, either version 3 // by the Free Software Foundation, either version 3
// of the License or (at your option) any later version. // of the License or (at your option) any later version.
// (see http://www.opensource.org/licenses for more info) // (see http://www.opensource.org/licenses for more info)
//! \addtogroup op_pinv //! \addtogroup op_pinv
//! @{ //! @{
template<typename eT> template<typename eT>
inline inline
void void
op_pinv::direct_pinv(Mat<eT>& out, const Mat<eT>& A, eT tol) op_pinv::direct_pinv(Mat<eT>& out, const Mat<eT>& A, const eT in_tol)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename get_pod_type<eT>::result T;
T tol = access::tmp_real(in_tol);
arma_debug_check((tol < T(0)), "pinv(): tolerance must be >= 0");
const uword n_rows = A.n_rows; const uword n_rows = A.n_rows;
const uword n_cols = A.n_cols; const uword n_cols = A.n_cols;
// economical SVD decomposition // economical SVD decomposition
Mat<eT> U; Mat<eT> U;
Col<eT> s; Col< T> s;
Mat<eT> V; Mat<eT> V;
const bool status = (n_cols > n_rows) ? auxlib::svd_econ(U,s,V,trans(A const bool status = (n_cols > n_rows) ? auxlib::svd_econ(U,s,V,trans(A),'
),'b') : auxlib::svd_econ(U,s,V,A,'b'); b') : auxlib::svd_econ(U,s,V,A,'b');
const uword s_n_elem = s.n_elem;
if(status == false) if(status == false)
{ {
out.reset(); out.reset();
arma_bad("pinv(): svd failed"); arma_bad("pinv(): svd failed");
return; return;
} }
const uword s_n_elem = s.n_elem;
const T* s_mem = s.memptr();
// set tolerance to default if it hasn't been specified as an argument // set tolerance to default if it hasn't been specified as an argument
if( (tol == eT(0)) && (s_n_elem > 0) ) if( (tol == T(0)) && (s_n_elem > 0) )
{ {
tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s)); tol = (std::max)(n_rows, n_cols) * eop_aux::direct_eps( op_max::direct_ max(s_mem, s_n_elem) );
} }
// count non zero valued elements in s // count non zero valued elements in s
const eT* s_mem = s.memptr();
uword count = 0; uword count = 0;
for(uword i=0; i < s_n_elem; ++i) for(uword i = 0; i < s_n_elem; ++i)
{ {
if(s_mem[i] > tol) if(s_mem[i] > tol)
{ {
++count; ++count;
} }
} }
if(count != 0) if(count != 0)
{ {
Col<eT> s2(count); Col<T> s2(count);
eT* s2_mem = s2.memptr(); T* s2_mem = s2.memptr();
uword count2 = 0; uword count2 = 0;
for(uword i=0; i < s_n_elem; ++i) for(uword i=0; i < s_n_elem; ++i)
{ {
const eT val = s_mem[i]; const T val = s_mem[i];
if(val > tol) if(val > tol)
{ {
s2_mem[count2] = eT(1) / val; s2_mem[count2] = T(1) / val;
++count2; ++count2;
} }
} }
if(A.n_cols <= A.n_rows) if(n_rows >= n_cols)
{ {
out = ( V.n_cols > count ? V.cols(0,count-1) : V ) * diagmat(s2) * tr ans( U.n_cols > count ? U.cols(0,count-1) : U ); out = ( V.n_cols > count ? V.cols(0,count-1) : V ) * diagmat(s2) * tr ans( U.n_cols > count ? U.cols(0,count-1) : U );
} }
else else
{ {
out = ( U.n_cols > count ? U.cols(0,count-1) : U ) * diagmat(s2) * tr ans( V.n_cols > count ? V.cols(0,count-1) : V ); out = ( U.n_cols > count ? U.cols(0,count-1) : U ) * diagmat(s2) * tr ans( V.n_cols > count ? V.cols(0,count-1) : V );
} }
} }
else else
{ {
out.zeros(n_cols, n_rows); out.zeros(n_cols, n_rows);
} }
} }
template<typename T>
inline
void
op_pinv::direct_pinv(Mat< std::complex<T> >& out, const Mat< std::complex<T
> >& A, T tol)
{
arma_extra_debug_sigprint();
const uword n_rows = A.n_rows;
const uword n_cols = A.n_cols;
typedef typename std::complex<T> eT;
// economical SVD decomposition
Mat<eT> U;
Col< T> s;
Mat<eT> V;
const bool status = (n_cols > n_rows) ? auxlib::svd_econ(U,s,V,trans(A),
'b') : auxlib::svd_econ(U,s,V,A,'b');
const uword s_n_elem = s.n_elem;
if(status == false)
{
out.reset();
arma_bad("pinv(): svd failed");
return;
}
// set tolerance to default if it hasn't been specified as an argument
if( (tol == T(0)) && (s_n_elem > 0) )
{
tol = (std::max)(n_rows,n_cols) * eop_aux::direct_eps(max(s));
}
// count non zero valued elements in s
uword count = 0;
for(uword i = 0; i < s_n_elem; ++i)
{
if(s[i] > tol)
{
++count;
}
}
if(count != 0)
{
// reduce the length of s in order to contain only the values above tol
erance
if(count < s_n_elem)
{
// s = s.rows(0,count-1);
s.shed_rows(count, s_n_elem-1);
}
// set the elements of s equal to their reciprocals
s = T(1) / s;
if(n_rows >= n_cols)
{
out = ( V.n_cols > count ? V.cols(0,count-1) : V ) * diagmat(s) * tra
ns( U.n_cols > count ? U.cols(0,count-1) : U );
}
else
{
out = ( U.n_cols > count ? U.cols(0,count-1) : U ) * diagmat(s) * tra
ns( V.n_cols > count ? V.cols(0,count-1) : V );
}
}
else
{
out.zeros(n_cols, n_rows);
}
}
template<typename T1> template<typename T1>
inline inline
void void
op_pinv::apply(Mat<typename T1::pod_type>& out, const Op<T1,op_pinv>& in) op_pinv::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_pinv>& in)
{ {
arma_extra_debug_sigprint(); arma_extra_debug_sigprint();
typedef typename T1::pod_type eT; typedef typename T1::elem_type eT;
const eT tol = in.aux;
arma_debug_check((tol < eT(0)), "pinv(): tolerance must be >= 0");
const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M;
op_pinv::direct_pinv(out, A, tol);
}
template<typename T1>
inline
void
op_pinv::apply(Mat< std::complex<typename T1::pod_type> >& out, const Op<T1
,op_pinv>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::pod_type T;
typedef typename std::complex<T> eT;
const T tol = in.aux.real();
arma_debug_check((tol < T(0)), "pinv(): tolerance must be >= 0");
const unwrap<T1> tmp(in.m); const unwrap<T1> tmp(in.m);
const Mat<eT>& A = tmp.M; const Mat<eT>& A = tmp.M;
op_pinv::direct_pinv(out, A, tol); op_pinv::direct_pinv(out, A, in.aux);
} }
//! @} //! @}
 End of changes. 18 change blocks. 
120 lines changed or deleted 24 lines changed or added


 podarray_meat.hpp   podarray_meat.hpp 
skipping to change at line 214 skipping to change at line 214
// note: this function assumes that the podarray has been set to the corr ect size beforehand // note: this function assumes that the podarray has been set to the corr ect size beforehand
eT* out = memptr(); eT* out = memptr();
switch(cols) switch(cols)
{ {
default: default:
{ {
uword i,j; uword i,j;
for(i=0, j=1; j < cols; i+=2, j+=2) for(i=0, j=1; j < cols; i+=2, j+=2)
{ {
out[i] = A.at(row, i); const eT tmp_i = A.at(row, i);
out[j] = A.at(row, j); const eT tmp_j = A.at(row, j);
out[i] = tmp_i;
out[j] = tmp_j;
} }
if(i < cols) if(i < cols)
{ {
out[i] = A.at(row, i); out[i] = A.at(row, i);
} }
} }
break; break;
case 8: case 8:
 End of changes. 1 change blocks. 
2 lines changed or deleted 5 lines changed or added


 subview_cube_meat.hpp   subview_cube_meat.hpp 
skipping to change at line 513 skipping to change at line 513
// interpret the matrix as a cube with one slice // interpret the matrix as a cube with one slice
for(uword col = 0; col < t_n_cols; ++col) for(uword col = 0; col < t_n_cols; ++col)
{ {
arrayops::copy( t.slice_colptr(0, col), x.colptr(col), t_n_rows ); arrayops::copy( t.slice_colptr(0, col), x.colptr(col), t_n_rows );
} }
} }
else else
if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) ) if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) )
{ {
// interpret the matrix as a cube with one column
// and with the number of slices equal to the number of columns in the
matrix
for(uword i=0; i < t_n_slices; ++i) for(uword i=0; i < t_n_slices; ++i)
{ {
arrayops::copy( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ); arrayops::copy( t.slice_colptr(i, 0), x.colptr(i), t_n_rows );
} }
} }
else else
if( (t_n_rows == 1) && (t_n_cols == x_n_cols) && (t_n_slices == x_n_rows) ) if( (t_n_rows == 1) && (t_n_cols == x_n_rows) && (t_n_slices == x_n_cols) )
{ {
// interpret the matrix as a cube with one row
// and with the number of slices equal to the number of rows in the mat
rix
Cube<eT>& Q = *(t.m_ptr); Cube<eT>& Q = *(t.m_ptr);
const uword t_aux_row1 = t.aux_row1; const uword t_aux_row1 = t.aux_row1;
const uword t_aux_col1 = t.aux_col1; const uword t_aux_col1 = t.aux_col1;
const uword t_aux_slice1 = t.aux_slice1; const uword t_aux_slice1 = t.aux_slice1;
for(uword col=0; col < t_n_cols; ++col) for(uword slice=0; slice < t_n_slices; ++slice)
{ {
const eT* x_colptr = x.colptr(col); const uword mod_slice = t_aux_slice1 + slice;
const eT* x_colptr = x.colptr(slice);
uword i,j;
for(i=0, j=1; j < t_n_cols; i+=2, j+=2)
{
const eT tmp_i = x_colptr[i];
const eT tmp_j = x_colptr[j];
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) = tmp_i;
Q.at(t_aux_row1, t_aux_col1 + j, mod_slice) = tmp_j;
}
for(uword i=0; i < t_n_slices; ++i) if(i < t_n_cols)
{ {
Q.at(t_aux_row1, t_aux_col1 + col, t_aux_slice1 + i) = x_colptr[i]; Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) = x_colptr[i];
} }
} }
} }
else else
{ {
if(arma_config::debug == true) if(arma_config::debug == true)
{ {
arma_stop( arma_incompat_size_string(t, x, "copy into subcube") ); arma_stop( arma_incompat_size_string(t, x, "copy into subcube") );
} }
} }
skipping to change at line 588 skipping to change at line 594
} }
else else
if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) ) if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) )
{ {
for(uword i=0; i < t_n_slices; ++i) for(uword i=0; i < t_n_slices; ++i)
{ {
arrayops::inplace_plus( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ) ; arrayops::inplace_plus( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ) ;
} }
} }
else else
if( (t_n_rows == 1) && (t_n_cols == x_n_cols) && (t_n_slices == x_n_rows) ) if( (t_n_rows == 1) && (t_n_cols == x_n_rows) && (t_n_slices == x_n_cols) )
{ {
Cube<eT>& Q = *(t.m_ptr); Cube<eT>& Q = *(t.m_ptr);
const uword t_aux_row1 = t.aux_row1; const uword t_aux_row1 = t.aux_row1;
const uword t_aux_col1 = t.aux_col1; const uword t_aux_col1 = t.aux_col1;
const uword t_aux_slice1 = t.aux_slice1; const uword t_aux_slice1 = t.aux_slice1;
for(uword col=0; col < t_n_cols; ++col) for(uword slice=0; slice < t_n_slices; ++slice)
{ {
const eT* x_colptr = x.colptr(col); const uword mod_slice = t_aux_slice1 + slice;
for(uword i=0; i < t_n_slices; ++i) const eT* x_colptr = x.colptr(slice);
uword i,j;
for(i=0, j=1; j < t_n_cols; i+=2, j+=2)
{ {
Q.at(t_aux_row1, t_aux_col1 + col, t_aux_slice1 + i) += x_colptr[i] const eT tmp_i = x_colptr[i];
; const eT tmp_j = x_colptr[j];
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) += tmp_i;
Q.at(t_aux_row1, t_aux_col1 + j, mod_slice) += tmp_j;
}
if(i < t_n_cols)
{
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) += x_colptr[i];
} }
} }
} }
else else
{ {
if(arma_config::debug == true) if(arma_config::debug == true)
{ {
arma_stop( arma_incompat_size_string(t, x, "addition") ); arma_stop( arma_incompat_size_string(t, x, "addition") );
} }
} }
skipping to change at line 651 skipping to change at line 669
} }
else else
if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) ) if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) )
{ {
for(uword i=0; i < t_n_slices; ++i) for(uword i=0; i < t_n_slices; ++i)
{ {
arrayops::inplace_minus( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ); arrayops::inplace_minus( t.slice_colptr(i, 0), x.colptr(i), t_n_rows );
} }
} }
else else
if( (t_n_rows == 1) && (t_n_cols == x_n_cols) && (t_n_slices == x_n_rows) ) if( (t_n_rows == 1) && (t_n_cols == x_n_rows) && (t_n_slices == x_n_cols) )
{ {
Cube<eT>& Q = *(t.m_ptr); Cube<eT>& Q = *(t.m_ptr);
const uword t_aux_row1 = t.aux_row1; const uword t_aux_row1 = t.aux_row1;
const uword t_aux_col1 = t.aux_col1; const uword t_aux_col1 = t.aux_col1;
const uword t_aux_slice1 = t.aux_slice1; const uword t_aux_slice1 = t.aux_slice1;
for(uword col=0; col < t_n_cols; ++col) for(uword slice=0; slice < t_n_slices; ++slice)
{ {
const eT* x_colptr = x.colptr(col); const uword mod_slice = t_aux_slice1 + slice;
const eT* x_colptr = x.colptr(slice);
for(uword i=0; i < t_n_slices; ++i) uword i,j;
for(i=0, j=1; j < t_n_cols; i+=2, j+=2)
{ {
Q.at(t_aux_row1, t_aux_col1 + col, t_aux_slice1 + i) -= x_colptr[i] const eT tmp_i = x_colptr[i];
; const eT tmp_j = x_colptr[j];
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) -= tmp_i;
Q.at(t_aux_row1, t_aux_col1 + j, mod_slice) -= tmp_j;
}
if(i < t_n_cols)
{
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) -= x_colptr[i];
} }
} }
} }
else else
{ {
if(arma_config::debug == true) if(arma_config::debug == true)
{ {
arma_stop( arma_incompat_size_string(t, x, "subtraction") ); arma_stop( arma_incompat_size_string(t, x, "subtraction") );
} }
} }
skipping to change at line 714 skipping to change at line 744
} }
else else
if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) ) if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) )
{ {
for(uword i=0; i < t_n_slices; ++i) for(uword i=0; i < t_n_slices; ++i)
{ {
arrayops::inplace_mul( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ); arrayops::inplace_mul( t.slice_colptr(i, 0), x.colptr(i), t_n_rows );
} }
} }
else else
if( (t_n_rows == 1) && (t_n_cols == x_n_cols) && (t_n_slices == x_n_rows) ) if( (t_n_rows == 1) && (t_n_cols == x_n_rows) && (t_n_slices == x_n_cols) )
{ {
Cube<eT>& Q = *(t.m_ptr); Cube<eT>& Q = *(t.m_ptr);
const uword t_aux_row1 = t.aux_row1; const uword t_aux_row1 = t.aux_row1;
const uword t_aux_col1 = t.aux_col1; const uword t_aux_col1 = t.aux_col1;
const uword t_aux_slice1 = t.aux_slice1; const uword t_aux_slice1 = t.aux_slice1;
for(uword col=0; col < t_n_cols; ++col) for(uword slice=0; slice < t_n_slices; ++slice)
{ {
const eT* x_colptr = x.colptr(col); const uword mod_slice = t_aux_slice1 + slice;
const eT* x_colptr = x.colptr(slice);
for(uword i=0; i < t_n_slices; ++i) uword i,j;
for(i=0, j=1; j < t_n_cols; i+=2, j+=2)
{ {
Q.at(t_aux_row1, t_aux_col1 + col, t_aux_slice1 + i) *= x_colptr[i] const eT tmp_i = x_colptr[i];
; const eT tmp_j = x_colptr[j];
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) *= tmp_i;
Q.at(t_aux_row1, t_aux_col1 + j, mod_slice) *= tmp_j;
}
if(i < t_n_cols)
{
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) *= x_colptr[i];
} }
} }
} }
else else
{ {
if(arma_config::debug == true) if(arma_config::debug == true)
{ {
arma_stop( arma_incompat_size_string(t, x, "element-wise multiplicati on") ); arma_stop( arma_incompat_size_string(t, x, "element-wise multiplicati on") );
} }
} }
skipping to change at line 777 skipping to change at line 819
} }
else else
if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) ) if( (t_n_rows == x_n_rows) && (t_n_cols == 1) && (t_n_slices == x_n_cols) )
{ {
for(uword i=0; i < t_n_slices; ++i) for(uword i=0; i < t_n_slices; ++i)
{ {
arrayops::inplace_div( t.slice_colptr(i, 0), x.colptr(i), t_n_rows ); arrayops::inplace_div( t.slice_colptr(i, 0), x.colptr(i), t_n_rows );
} }
} }
else else
if( (t_n_rows == 1) && (t_n_cols == x_n_cols) && (t_n_slices == x_n_rows) ) if( (t_n_rows == 1) && (t_n_cols == x_n_rows) && (t_n_slices == x_n_cols) )
{ {
Cube<eT>& Q = *(t.m_ptr); Cube<eT>& Q = *(t.m_ptr);
const uword t_aux_row1 = t.aux_row1; const uword t_aux_row1 = t.aux_row1;
const uword t_aux_col1 = t.aux_col1; const uword t_aux_col1 = t.aux_col1;
const uword t_aux_slice1 = t.aux_slice1; const uword t_aux_slice1 = t.aux_slice1;
for(uword col=0; col < t_n_cols; ++col) for(uword slice=0; slice < t_n_slices; ++slice)
{ {
const eT* x_colptr = x.colptr(col); const uword mod_slice = t_aux_slice1 + slice;
const eT* x_colptr = x.colptr(slice);
uword i,j;
for(i=0, j=1; j < t_n_cols; i+=2, j+=2)
{
const eT tmp_i = x_colptr[i];
const eT tmp_j = x_colptr[j];
Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) /= tmp_i;
Q.at(t_aux_row1, t_aux_col1 + j, mod_slice) /= tmp_j;
}
for(uword i=0; i < t_n_slices; ++i) if(i < t_n_cols)
{ {
Q.at(t_aux_row1, t_aux_col1 + col, t_aux_slice1 + i) /= x_colptr[i] ; Q.at(t_aux_row1, t_aux_col1 + i, mod_slice) /= x_colptr[i];
} }
} }
} }
else else
{ {
if(arma_config::debug == true) if(arma_config::debug == true)
{ {
arma_stop( arma_incompat_size_string(t, x, "element-wise division") ) ; arma_stop( arma_incompat_size_string(t, x, "element-wise division") ) ;
} }
} }
skipping to change at line 1197 skipping to change at line 1251
out.set_size(in_n_rows, in_n_slices); out.set_size(in_n_rows, in_n_slices);
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::copy( out.colptr(i), in.slice_colptr(i, 0), in_n_rows ) ; arrayops::copy( out.colptr(i), in.slice_colptr(i, 0), in_n_rows ) ;
} }
} }
else else
if(in_n_rows == 1) if(in_n_rows == 1)
{ {
out.set_size(in_n_slices, in_n_cols);
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
const uword in_aux_row1 = in.aux_row1; const uword in_aux_row1 = in.aux_row1;
const uword in_aux_col1 = in.aux_col1; const uword in_aux_col1 = in.aux_col1;
const uword in_aux_slice1 = in.aux_slice1; const uword in_aux_slice1 = in.aux_slice1;
for(uword col=0; col < in_n_cols; ++col) out.set_size(in_n_cols, in_n_slices);
for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); const uword mod_slice = in_aux_slice1 + slice;
eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
const eT tmp_j = Q.at(in_aux_row1, in_aux_col1 + j, mod_slice);
out_colptr[i] = tmp_i;
out_colptr[j] = tmp_j;
}
for(uword i=0; i < in_n_slices; ++i) if(i < in_n_cols)
{ {
out_colptr[i] = Q.at(in_aux_row1, in_aux_col1 + col, in_aux_sli ce1 + i); out_colptr[i] = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
} }
} }
} }
} }
else else
{ {
out.set_size(in_n_slices); out.set_size(in_n_slices);
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
skipping to change at line 1273 skipping to change at line 1339
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_plus( out.colptr(i), in.slice_colptr(i, 0), in_ n_rows ); arrayops::inplace_plus( out.colptr(i), in.slice_colptr(i, 0), in_ n_rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
const uword in_aux_row1 = in.aux_row1; const uword in_aux_row1 = in.aux_row1;
const uword in_aux_col1 = in.aux_col1; const uword in_aux_col1 = in.aux_col1;
const uword in_aux_slice1 = in.aux_slice1; const uword in_aux_slice1 = in.aux_slice1;
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); const uword mod_slice = in_aux_slice1 + slice;
for(uword i=0; i < in_n_slices; ++i) eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{ {
out_colptr[i] += Q.at(in_aux_row1, in_aux_col1 + col, in_aux_sl const eT tmp_i = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
ice1 + i); const eT tmp_j = Q.at(in_aux_row1, in_aux_col1 + j, mod_slice);
out_colptr[i] += tmp_i;
out_colptr[j] += tmp_j;
}
if(i < in_n_cols)
{
out_colptr[i] += Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
skipping to change at line 1347 skipping to change at line 1425
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_minus( out.colptr(i), in.slice_colptr(i, 0), in _n_rows ); arrayops::inplace_minus( out.colptr(i), in.slice_colptr(i, 0), in _n_rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
const uword in_aux_row1 = in.aux_row1; const uword in_aux_row1 = in.aux_row1;
const uword in_aux_col1 = in.aux_col1; const uword in_aux_col1 = in.aux_col1;
const uword in_aux_slice1 = in.aux_slice1; const uword in_aux_slice1 = in.aux_slice1;
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); const uword mod_slice = in_aux_slice1 + slice;
eT* out_colptr = out.colptr(slice);
for(uword i=0; i < in_n_slices; ++i) uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{ {
out_colptr[i] -= Q.at(in_aux_row1, in_aux_col1 + col, in_aux_sl const eT tmp_i = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
ice1 + i); const eT tmp_j = Q.at(in_aux_row1, in_aux_col1 + j, mod_slice);
out_colptr[i] -= tmp_i;
out_colptr[j] -= tmp_j;
}
if(i < in_n_cols)
{
out_colptr[i] -= Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
skipping to change at line 1421 skipping to change at line 1511
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_mul( out.colptr(i), in.slice_colptr(i, 0), in_n _rows ); arrayops::inplace_mul( out.colptr(i), in.slice_colptr(i, 0), in_n _rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
const uword in_aux_row1 = in.aux_row1; const uword in_aux_row1 = in.aux_row1;
const uword in_aux_col1 = in.aux_col1; const uword in_aux_col1 = in.aux_col1;
const uword in_aux_slice1 = in.aux_slice1; const uword in_aux_slice1 = in.aux_slice1;
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); const uword mod_slice = in_aux_slice1 + slice;
eT* out_colptr = out.colptr(slice);
for(uword i=0; i < in_n_slices; ++i) uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{ {
out_colptr[i] *= Q.at(in_aux_row1, in_aux_col1 + col, in_aux_sl const eT tmp_i = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
ice1 + i); const eT tmp_j = Q.at(in_aux_row1, in_aux_col1 + j, mod_slice);
out_colptr[i] *= tmp_i;
out_colptr[j] *= tmp_j;
}
if(i < in_n_cols)
{
out_colptr[i] *= Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
skipping to change at line 1495 skipping to change at line 1597
if(out_vec_state == 0) if(out_vec_state == 0)
{ {
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) ) if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{ {
for(uword i=0; i < in_n_slices; ++i) for(uword i=0; i < in_n_slices; ++i)
{ {
arrayops::inplace_div( out.colptr(i), in.slice_colptr(i, 0), in_n _rows ); arrayops::inplace_div( out.colptr(i), in.slice_colptr(i, 0), in_n _rows );
} }
} }
else else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) ) if( (in_n_rows == 1) && (in_n_cols == out_n_rows) && (in_n_slices == out_n_cols) )
{ {
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
const uword in_aux_row1 = in.aux_row1; const uword in_aux_row1 = in.aux_row1;
const uword in_aux_col1 = in.aux_col1; const uword in_aux_col1 = in.aux_col1;
const uword in_aux_slice1 = in.aux_slice1; const uword in_aux_slice1 = in.aux_slice1;
for(uword col=0; col < in_n_cols; ++col) for(uword slice=0; slice < in_n_slices; ++slice)
{ {
eT* out_colptr = out.colptr(col); const uword mod_slice = in_aux_slice1 + slice;
eT* out_colptr = out.colptr(slice);
uword i,j;
for(i=0, j=1; j < in_n_cols; i+=2, j+=2)
{
const eT tmp_i = Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
const eT tmp_j = Q.at(in_aux_row1, in_aux_col1 + j, mod_slice);
out_colptr[i] /= tmp_i;
out_colptr[j] /= tmp_j;
}
for(uword i=0; i < in_n_slices; ++i) if(i < in_n_cols)
{ {
out_colptr[i] /= Q.at(in_aux_row1, in_aux_col1 + col, in_aux_sl ice1 + i); out_colptr[i] /= Q.at(in_aux_row1, in_aux_col1 + i, mod_slice);
} }
} }
} }
} }
else else
{ {
eT* out_mem = out.memptr(); eT* out_mem = out.memptr();
const Cube<eT>& Q = in.m; const Cube<eT>& Q = in.m;
 End of changes. 52 change blocks. 
65 lines changed or deleted 171 lines changed or added


 typedef.hpp   typedef.hpp 
skipping to change at line 95 skipping to change at line 95
typedef u64 uword; typedef u64 uword;
typedef s64 sword; typedef s64 sword;
typedef u32 uhword; typedef u32 uhword;
typedef s32 shword; typedef s32 shword;
#define ARMA_MAX_UWORD 0xffffffffffffffff #define ARMA_MAX_UWORD 0xffffffffffffffff
#define ARMA_MAX_UHWORD 0xffffffff #define ARMA_MAX_UHWORD 0xffffffff
#endif #endif
#if defined(ARMA_BLAS_LONG_LONG)
typedef long long blas_int;
#elif defined(ARMA_BLAS_LONG)
typedef long blas_int;
#else
typedef int blas_int;
#endif
typedef std::complex<float> cx_float; typedef std::complex<float> cx_float;
typedef std::complex<double> cx_double; typedef std::complex<double> cx_double;
typedef Mat <unsigned char> uchar_mat; typedef Mat <unsigned char> uchar_mat;
typedef Col <unsigned char> uchar_vec; typedef Col <unsigned char> uchar_vec;
typedef Col <unsigned char> uchar_colvec; typedef Col <unsigned char> uchar_colvec;
typedef Row <unsigned char> uchar_rowvec; typedef Row <unsigned char> uchar_rowvec;
typedef Cube<unsigned char> uchar_cube; typedef Cube<unsigned char> uchar_cube;
typedef Mat <u32> u32_mat; typedef Mat <u32> u32_mat;
 End of changes. 1 change blocks. 
8 lines changed or deleted 0 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/