[Rcpp-commits] r3401 - in pkg/RcppArmadillo: . inst inst/include inst/include/armadillo_bits

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 28 15:21:56 CET 2011


Author: edd
Date: 2011-11-28 15:21:55 +0100 (Mon, 28 Nov 2011)
New Revision: 3401

Added:
   pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_wrapper.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/blas_wrapper.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/include_atlas.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/lapack_wrapper.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/typedef_blas_int.hpp
Removed:
   pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/BaseCube.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_static_assert.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/typedef_u64.hpp
Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/inst/include/armadillo
   pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/blas_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/debug.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_accu.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/injector_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/lapack_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/mtGlueCube_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/mtGlue_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_dot_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_pinv_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_pinv_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/podarray_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/subview_cube_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/typedef.hpp
Log:
RcppArmadillo 0.2.31 wrapping Armadillo 2.3.92


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/ChangeLog	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,3 +1,9 @@
+2011-11-28  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.31
+
+	* inst/include/*: Upgraded to new test release 2.3.92 of Armadillo
+
 2011-11-19  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.30

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.30
+Version: 0.2.31
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Romain Francois, Dirk Eddelbuettel and Doug Bates <RcppArmadillo-authors at r-enthusiasts.com>
@@ -21,7 +21,7 @@
  (due to speed and/or integration capabilities), rather than another language.
  .
  The RcppArmadillo package includes the header files from the templated
- Armadillo library (currently version 2.2.1). Thus users do not need to
+ Armadillo library (currently version 2.3.92). Thus users do not need to
  install Armadillo itself in order to use RcppArmadillo.
  .
  This Armadillo integration provides a nice illustration of the 

Modified: pkg/RcppArmadillo/inst/NEWS
===================================================================
--- pkg/RcppArmadillo/inst/NEWS	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/NEWS	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,3 +1,11 @@
+0.2.31  2011-11-28
+
+    o   Upgraded to Armadillo test release 2.3.92 "Loco Lounge Lizard (Beta 2)"
+
+          * fixes for linking on Ubuntu and Debian systems
+          * fixes for inconsistencies in interactions between matrices and
+            cubes
+
 0.2.30  2011-11-19
 
     o   Upgraded to Armadillo test release 2.3.91 "Loco Lounge Lizard (Beta 1)"

Modified: pkg/RcppArmadillo/inst/include/armadillo
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo	2011-11-28 14:21:55 UTC (rev 3401)
@@ -72,37 +72,7 @@
 #endif
 
 
-#define ARMA_INCFILE_WRAP(x) <x>
-
-
-#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/include_atlas.hpp"
 #include "armadillo_bits/itpp_wrap.hpp"
 
 
@@ -115,6 +85,7 @@
   #include "armadillo_bits/forward_bones.hpp"
   #include "armadillo_bits/arma_static_check.hpp"
   #include "armadillo_bits/typedef.hpp"
+  #include "armadillo_bits/typedef_blas_int.hpp"
   #include "armadillo_bits/format_wrap.hpp"
   #include "armadillo_bits/arma_version.hpp"
   #include "armadillo_bits/arma_config.hpp"
@@ -137,6 +108,10 @@
   #include "armadillo_bits/lapack_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/podarray_bones.hpp"
   #include "armadillo_bits/auxlib_bones.hpp"

Deleted: pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,39 +0,0 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
-// 
-// This file is part of the Armadillo C++ library.
-// It is provided without any warranty of fitness
-// for any purpose. You can redistribute this file
-// and/or modify it under the terms of the GNU
-// Lesser General Public License (LGPL) as published
-// by the Free Software Foundation, either version 3
-// of the License or (at your option) any later version.
-// (see http://www.opensource.org/licenses for more info)
-
-
-//! \addtogroup Base
-//! @{
-
-
-
-//! Class for static polymorphism, modelled after the "Curiously Recurring Template Pattern" (CRTP).
-//! Used for type-safe downcasting in functions that restrict their input(s) to be classes that are
-//! derived from Base (e.g. Mat, Op, Glue, diagview, subview).
-//! A Base object can be converted to a Mat object by the unwrap class.
-
-template<typename elem_type, typename derived>
-struct Base
-  {
-  
-  arma_inline
-  const derived&
-  get_ref() const
-    {
-    return static_cast<const derived&>(*this);
-    }
-
-  };
-
-
-
-//! @}

Deleted: pkg/RcppArmadillo/inst/include/armadillo_bits/BaseCube.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/BaseCube.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/BaseCube.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,35 +0,0 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
-// 
-// This file is part of the Armadillo C++ library.
-// It is provided without any warranty of fitness
-// for any purpose. You can redistribute this file
-// and/or modify it under the terms of the GNU
-// Lesser General Public License (LGPL) as published
-// by the Free Software Foundation, either version 3
-// of the License or (at your option) any later version.
-// (see http://www.opensource.org/licenses for more info)
-
-
-//! \addtogroup BaseCube
-//! @{
-
-
-
-//! Analog of the Base class, intended for cubes
-template<typename elem_type, typename derived>
-struct BaseCube
-  {
-  
-  arma_inline
-  const derived&
-  get_ref() const
-    {
-    return static_cast<const derived&>(*this);
-    }
-
-  };
-
-
-
-//! @}

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -274,7 +274,7 @@
   arma_inline arma_warn_unused bool is_square() 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 uword   in_row, const uword   in_col) const;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -900,16 +900,26 @@
       else
       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);
+            }
           }
         }
       }
@@ -973,16 +983,26 @@
           }
         }
       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);
           
-          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);
+            }
           }
         }
       }
@@ -1044,16 +1064,26 @@
           }
         }
       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);
           
-          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);
+            }
           }
         }
       }
@@ -1132,16 +1162,26 @@
           }
         }
       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);
           
-          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);
+            }
           }
         }
       }
@@ -1203,16 +1243,26 @@
           }
         }
       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);
           
-          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);
+            }
           }
         }
       }

Deleted: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_static_assert.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_static_assert.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_static_assert.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,65 +0,0 @@
-// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2011 Conrad Sanderson
-// 
-// This file is part of the Armadillo C++ library.
-// It is provided without any warranty of fitness
-// for any purpose. You can redistribute this file
-// and/or modify it under the terms of the GNU
-// Lesser General Public License (LGPL) as published
-// by the Free Software Foundation, either version 3
-// of the License or (at your option) any later version.
-// (see http://www.opensource.org/licenses for more info)
-
-
-//! \addtogroup arma_static_assert
-//! @{
-
-
-
-//! Classes for primitive compile time assertions and checks (until the next version of C++)
-template<bool x>
-struct arma_static_assert
-  {
-  static const char
-  static_error[  x ? +1 : -1 ];
-  };
-
-
-
-template<bool x>
-struct arma_static_check
-  {
-  static const char
-  static_error[  x ? -1 : +1 ];
-  };
-
-
-
-template<bool val>
-struct arma_type_check
-  {
-  arma_inline
-  static
-  void
-  apply()
-    {
-    arma_static_check<val> ERROR___INCORRECT_TYPE;
-    ERROR___INCORRECT_TYPE = ERROR___INCORRECT_TYPE;
-    }
-  };
-
-
-
-template<>
-struct arma_type_check<false>
-  {
-  arma_inline
-  static
-  void
-  apply()
-    {
-    }
-  };
-
-
-//! @}

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -18,8 +18,8 @@
 
 #define ARMA_VERSION_MAJOR 2
 #define ARMA_VERSION_MINOR 3
-#define ARMA_VERSION_PATCH 91
-#define ARMA_VERSION_NAME  "Loco Lounge Lizard (Beta 1)"
+#define ARMA_VERSION_PATCH 92
+#define ARMA_VERSION_NAME  "Loco Lounge Lizard (Beta 2)"
 
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_bones.hpp	2011-11-27 21:56:48 UTC (rev 3400)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_bones.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -13,6 +13,7 @@
 
 #ifdef ARMA_USE_ATLAS
 
+
 //! \namespace atlas namespace for ATLAS functions (imported from the global namespace)
 namespace atlas
   {
@@ -20,269 +21,69 @@
   using ::CblasColMajor;
   using ::CblasNoTrans;
   using ::CblasTrans;
+  using ::CblasConjTrans;
   
-  using ::cblas_sdot;
-  using ::cblas_ddot;
-  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.real(); }
-  
-  
-  
-  template<typename eT>
-  arma_inline
-  eT
-  cblas_dot(const int N, const eT* X, const eT* Y)
+  #if defined(ARMA_USE_WRAPPER)
+  extern "C"
     {
-    arma_type_check((is_supported_blas_type<eT>::value == false));
     
-    if(is_float<eT>::value == true)
-      {
-      typedef float T;
-      return eT( cblas_sdot(N, (const T*)X, 1, (const T*)Y, 1) );
-      }
-    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>
-  arma_inline
-  eT
-  cx_cblas_dot(const int N, const eT* X, const eT* Y)
-    {
-    arma_type_check((is_supported_blas_type<eT>::value == false));
+    float  wrapper_cblas_sdot(const int N, const float  *X, const int incX, const float  *Y, const int incY);
+    double wrapper_cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY);
     
-    if(is_supported_complex_float<eT>::value == true)
-      {
-      typedef typename std::complex<float> T;
-      
-      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>
-  inline
-  void
-  cblas_gemv
-    (
-    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));
+    void wrapper_cblas_cdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu);
+    void wrapper_cblas_zdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu);
     
-    if(is_float<eT>::value == true)
-      {
-      typedef float T;
-      cblas_sgemv(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_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>
-  inline
-  void
-  cblas_gemm
-    (
-    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)
-      {
-      typedef float T;
-      cblas_sgemm(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_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>
-  inline
-  int
-  clapack_getrf
-    (
-    const enum CBLAS_ORDER Order, const int M, const int N,
-    eT *A, const int lda, int *ipiv
-    )
-    {
-    arma_type_check((is_supported_blas_type<eT>::value == false));
+    void wrapper_cblas_sgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha,
+                             const float *A, const int lda, const float *X, const int incX, const float beta, float *Y, const int incY);
     
-    if(is_float<eT>::value == true)
-      {
-      typedef float T;
-      return clapack_sgetrf(Order, M, N, (T*)A, lda, ipiv);
-      }
-    else
-    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>
-  inline
-  int
-  clapack_getri
-    (
-    const enum CBLAS_ORDER Order, const int N, eT *A,
-    const int lda, const int *ipiv
-    )
-    {
-    arma_type_check((is_supported_blas_type<eT>::value == false));
+    void wrapper_cblas_dgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const double alpha,
+                             const double *A, const int lda, const double *X, const int incX, const double beta, double *Y, const int incY);
     
-    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;
-      }
+    void wrapper_cblas_cgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha,
+                             const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY);
+    
+    void wrapper_cblas_zgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha,
+                             const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY);
+    
+    
+    
+    void wrapper_cblas_sgemm(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 float alpha,
+                             const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc);
+    
+    void wrapper_cblas_dgemm(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 double alpha,
+                             const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc);
+    
+    void wrapper_cblas_cgemm(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 void *alpha,
+                             const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc);
+    
+    void wrapper_cblas_zgemm(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 void *alpha,
+                             const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc);
+    
+    
+    int wrapper_clapack_sgetrf(const enum CBLAS_ORDER Order, const int M, const int N, float  *A, const int lda, int *ipiv);
+    int wrapper_clapack_dgetrf(const enum CBLAS_ORDER Order, const int M, const int N, double *A, const int lda, int *ipiv);
+    int wrapper_clapack_cgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void   *A, const int lda, int *ipiv);
+    int wrapper_clapack_zgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void   *A, const int lda, int *ipiv);
+    
+    int wrapper_clapack_sgetri(const enum CBLAS_ORDER Order, const int N, float  *A, const int lda, const int *ipiv);
+    int wrapper_clapack_dgetri(const enum CBLAS_ORDER Order, const int N, double *A, const int lda, const int *ipiv);
+    int wrapper_clapack_cgetri(const enum CBLAS_ORDER Order, const int N, void   *A, const int lda, const int *ipiv);
+    int wrapper_clapack_zgetri(const enum CBLAS_ORDER Order, const int N, void   *A, const int lda, const int *ipiv);
+
+    int wrapper_clapack_sgesv(const enum CBLAS_ORDER Order, const int N, const 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, const 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, const 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, const int NRHS, void   *A, const int lda, int *ipiv, void   *B, const int ldb);
+    
     }
+  #endif
   
-  
-  
   }
 
+
 #endif

Added: pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_wrapper.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_wrapper.hpp	                        (rev 0)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/atlas_wrapper.hpp	2011-11-28 14:21:55 UTC (rev 3401)
@@ -0,0 +1,303 @@
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
+// 
+// This file is part of the Armadillo C++ library.
+// It is provided without any warranty of fitness
+// for any purpose. You can redistribute this file
+// and/or modify it under the terms of the GNU
+// Lesser General Public License (LGPL) as published
+// by the Free Software Foundation, either version 3
+// of the License or (at your option) any later version.
+// (see http://www.opensource.org/licenses for more info)
+
+
+#ifdef ARMA_USE_ATLAS
+
+
+//! \namespace atlas namespace for ATLAS functions (imported from the global namespace)
+namespace atlas
+  {
+  
+  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.real(); }
+  
+  
+  
+  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)
+      {
+      typedef float T;
+      return eT( arma_atlas(cblas_sdot)(N, (const T*)X, 1, (const T*)Y, 1) );
+      }
+    else
+    if(is_double<eT>::value == true)
+      {
+      typedef double T;
+      return eT( arma_atlas(cblas_ddot)(N, (const T*)X, 1, (const T*)Y, 1) );
+      }
+    else
+      {
+      return eT(0);
+      }
+    }
+  
+  
+  
+  template<typename eT>
+  arma_inline
+  eT
+  cx_cblas_dot(const int N, const eT* X, const eT* Y)
+    {
+    arma_type_check((is_supported_blas_type<eT>::value == false));
+    
+    if(is_supported_complex_float<eT>::value == true)
+      {
+      typedef typename std::complex<float> T;
+      
+      T out;    
+      arma_atlas(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;
+      arma_atlas(cblas_zdotu_sub)(N, (const T*)X, 1, (const T*)Y, 1, &out);
+      
+      return eT(out);
+      }
+    else
+      {
+      return eT(0);
+      }
+    }
+  
+  
+  
+  template<typename eT>
+  inline
+  void
+  cblas_gemv
+    (
+    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)
+      {
+      typedef float T;
+      arma_atlas(cblas_sgemv)(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_double<eT>::value == true)
+      {
+      typedef double T;
+      arma_atlas(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;
+      arma_atlas(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;
+      arma_atlas(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>
+  inline
+  void
+  cblas_gemm
+    (
+    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)
+      {
+      typedef float T;
+      arma_atlas(cblas_sgemm)(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_double<eT>::value == true)
+      {
+      typedef double T;
+      arma_atlas(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;
+      arma_atlas(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;
+      arma_atlas(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>
+  inline
+  int
+  clapack_getrf
+    (
+    const enum CBLAS_ORDER Order, const int M, const int N,
+    eT *A, const int lda, int *ipiv
+    )
+    {
+    arma_type_check((is_supported_blas_type<eT>::value == false));
+    
+    if(is_float<eT>::value == true)
+      {
+      typedef float T;
+      return arma_atlas(clapack_sgetrf)(Order, M, N, (T*)A, lda, ipiv);
+      }
+    else
+    if(is_double<eT>::value == true)
+      {
+      typedef double T;
+      return arma_atlas(clapack_dgetrf)(Order, M, N, (T*)A, lda, ipiv);
+      }
+    else
+    if(is_supported_complex_float<eT>::value == true)
+      {
+      typedef std::complex<float> T;
+      return arma_atlas(clapack_cgetrf)(Order, M, N, (T*)A, lda, ipiv);
+      }
+    else
+    if(is_supported_complex_double<eT>::value == true)
+      {
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rcpp -r 3401


More information about the Rcpp-commits mailing list