Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ublas-dev] symmetric_adaptor problem with functional assign

Expand Messages
  • jhr.walter@t-online.de
    Hi all, ... OK, I ve investigated that problem and it turned out to be a problem in zero_matrix s find() functions. Fixed in my newest upload. ... Hm. Still
    Message 1 of 4 , Feb 8, 2003
      Hi all,

      I wrote:

      > > Here is the test case I promised. It shows up the problem when tested
      > > using uBLAS in boost CVS. The equals(m,cm) check in a debug build picks
      > > up the problem. These postcondition checks are very useful!!)
      > >
      > > {
      > > typedef sparse_matrix<float> MS;
      > > matrix<float> m(3,3);
      > > m(1,0) = 1; m(0,1) = 1; // numerically symmetric
      > >
      > > MS ms(3,3);
      > > ms.plus_assign (m); // ok
      > > ms.assign (m); // ok
      > >
      > > // Check that elements can be access via symmetric_adaptor
      > >
      > > symmetric_adaptor<MS> sms(ms);
      > > sms.plus_assign (m); // BADNESS
      > > sms.assign (m); // ok
      > > }
      > >
      > >
      > > The line label BADNESS will dispatch into the sparse(lvalue)
      > > proxy(rvalue) assign algorithm. This uses the definition of an iterator
      > > in a sparse storage type. It therefore applies the functional operator
      > > to all non-zero elements. This results in the function (plus in this
      > > case) being to both halves of the symmetric matrix and thus twice to any
      > > off diagonal element. Opps!
      >
      > Confirmed. I had to change the behaviour regarding sparse proxies back to
      > boost_1_29_0 semantics (disabling
      >
      > // #define BOOST_UBLAS_NON_CONFORMANT_PROXIES
      >
      > and adding some bug fixes) and this test case works (again ;-(.It looks as
      > if we'd have to reconsider the discussion started here
      >
      > http://groups.yahoo.com/group/ublas-dev/message/144,
      >
      > especially as I found some performance related problems with the extended
      > evaluators when testing with Alexei's symmetric sparse matrix tests, too
      > (sorry for not reporting them).

      OK, I've investigated that problem and it turned out to be a problem in
      zero_matrix's find() functions. Fixed in my newest upload.

      > Is it possible that requiring sparse proxy assignment to have structural
      > conforming lhs and rhs (i.e. the index set of the rhs is contained in the
      > index set of the lhs) is the best we can achieve generically?

      Hm. Still unsure about this. I think I first should try to fix Michael's
      problem.

      Best,

      Joerg
    • jhr.walter@t-online.de
      Hi Michael, hi all, ... picks ... iterator ... any ... to ... as ... extended ... the ... I tried that and just uploaded a new version to the files section
      Message 2 of 4 , Feb 9, 2003
        Hi Michael, hi all,

        I wrote:

        > > > Here is the test case I promised. It shows up the problem when tested
        > > > using uBLAS in boost CVS. The equals(m,cm) check in a debug build
        picks
        > > > up the problem. These postcondition checks are very useful!!)
        > > >
        > > > {
        > > > typedef sparse_matrix<float> MS;
        > > > matrix<float> m(3,3);
        > > > m(1,0) = 1; m(0,1) = 1; // numerically symmetric
        > > >
        > > > MS ms(3,3);
        > > > ms.plus_assign (m); // ok
        > > > ms.assign (m); // ok
        > > >
        > > > // Check that elements can be access via symmetric_adaptor
        > > >
        > > > symmetric_adaptor<MS> sms(ms);
        > > > sms.plus_assign (m); // BADNESS
        > > > sms.assign (m); // ok
        > > > }
        > > >
        > > >
        > > > The line label BADNESS will dispatch into the sparse(lvalue)
        > > > proxy(rvalue) assign algorithm. This uses the definition of an
        iterator
        > > > in a sparse storage type. It therefore applies the functional operator
        > > > to all non-zero elements. This results in the function (plus in this
        > > > case) being to both halves of the symmetric matrix and thus twice to
        any
        > > > off diagonal element. Opps!
        > >
        > > Confirmed. I had to change the behaviour regarding sparse proxies back
        to
        > > boost_1_29_0 semantics (disabling
        > >
        > > // #define BOOST_UBLAS_NON_CONFORMANT_PROXIES
        > >
        > > and adding some bug fixes) and this test case works (again ;-(.It looks
        as
        > > if we'd have to reconsider the discussion started here
        > >
        > > http://groups.yahoo.com/group/ublas-dev/message/144,
        > >
        > > especially as I found some performance related problems with the
        extended
        > > evaluators when testing with Alexei's symmetric sparse matrix tests, too
        > > (sorry for not reporting them).
        >
        > OK, I've investigated that problem and it turned out to be a problem in
        > zero_matrix's find() functions. Fixed in my newest upload.
        >
        > > Is it possible that requiring sparse proxy assignment to have structural
        > > conforming lhs and rhs (i.e. the index set of the rhs is contained in
        the
        > > index set of the lhs) is the best we can achieve generically?
        >
        > Hm. Still unsure about this. I think I first should try to fix Michael's
        > problem.

        I tried that and just uploaded a new version to the files section which
        fixes the original problem, too.

        Best,

        Joerg
      Your message has been successfully submitted and would be delivered to recipients shortly.