//===================================================== // File : hand_vec_interface.hh // Copyright (C) 2008 Gael Guennebaud //===================================================== // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #ifndef HAND_VEC_INTERFACE_HH #define HAND_VEC_INTERFACE_HH #include #include "f77_interface.hh" using namespace Eigen; template class hand_vec_interface : public f77_interface_base { public : typedef typename ei_packet_traits::type Packet; static const int PacketSize = ei_packet_traits::size; typedef typename f77_interface_base::stl_matrix stl_matrix; typedef typename f77_interface_base::stl_vector stl_vector; typedef typename f77_interface_base::gene_matrix gene_matrix; typedef typename f77_interface_base::gene_vector gene_vector; static void free_matrix(gene_matrix & A, int N){ ei_aligned_free(A); } static void free_vector(gene_vector & B){ ei_aligned_free(B); } static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ int N = A_stl.size(); A = ei_aligned_malloc(N*N); for (int j=0;j(N); for (int i=0;i0) { // int aligned0 = (iN0 % PacketSize); int aligned1 = (iN1 % PacketSize); if (aligned1==0) { for (int j = 0;j0) { bool aligned0 = (iN0 % PacketSize) == 0; if (aligned0) for (int j = 0;j0) // { // bool aligned0 = (iN0 % PacketSize) == 0; // bool aligned1 = (iN1 % PacketSize) == 0; // // if (aligned0 && aligned1) // { // for (int j = 0;j0) // { // bool aligned0 = (iN0 % PacketSize) == 0; // if (aligned0) // for (int j = 0;j0) // { // bool aligned = (iN % PacketSize) == 0; // if (aligned) // { // #ifdef PEELING // Packet A0, A1, A2, X0, X1, X2; // int ANP = (AN/(8*PacketSize))*8*PacketSize; // for (int j = 0;j0) { int align1 = (iN1 % PacketSize); if (align1==0) { for (int j = 0;j0) { if (iN0 % PacketSize==0) for (int j = 0;j0) // { // bool aligned = (iN % PacketSize) == 0; // if (aligned) // { // #ifdef PEELING // int ANP = (AN/(8*PacketSize))*8*PacketSize; // for (int j = 0;j0) { Packet pcoef = ei_pset1(coef); #ifdef PEELING int ANP = (AN/(8*PacketSize))*8*PacketSize; for (int j = 0;j