getfem-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] [gmm] apparent bug in csr_matrix_ref


From: Narayanan, Manikandan
Subject: [Getfem-users] [gmm] apparent bug in csr_matrix_ref
Date: Tue, 30 Sep 2008 14:26:13 -0400

Hi, 
  The csr_matrix_ref in gmm_interface.h (gmm Ver 3.1) has the following
member fn. 

struct csr_matrix_ref { 
  
  ...<snp>...

  value_type operator()(size_type i, size_type j) const
      { return mat_col(*this, i)[j]; }
}; 

  I am fairly sure that the mat_col above should be mat_row, since
csr_matrix is a row_major matrix, isn't it?  

  But I am very new to gmm and don't claim to understand the source
code, so I have not been able to exercise this bug in a program. I tried
the following code below (scaled() fn to get a reference to csr_matrix),
but the operator() on the reference returned by scaled() works
correctly!! Could someone experienced please help me understand? 


Thanks, 
Mani 


code to exercise bug (unsucessfully!!): 

#include <iostream>
#include <gmm/gmm.h>

using namespace std;
using namespace gmm;

int main()
{
  row_matrix< wsvector<double> > wa(10, 10);
  csr_matrix<double> a(10, 10);

  wa(1,1) = 1;
  wa(1,3) = 2;
  cout << wa;

  copy(wa, a);
  cout << scaled(a, 2);
  cout << (scaled(a, 2))(1,3) << endl;
  //(what should be the type of b??) b = scaled(a, 2); //doesn't
compile!
  //cout << b;
  //cout << b(1,1) << " " << b(1,3) << endl;
}

 
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]