Changeset 50fcf4d in tol


Ignore:
Timestamp:
May 19, 2011, 9:50:10 AM (15 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
b0a03cb
Parents:
d4464be
Message:

Refs #1073
Min and Max functions of Matrix didn't show error handling with real arguments but were not working fine.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3567 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/matrix_type/matgra.cpp

    rd4464be r50fcf4d  
    844844  for(n=2; args; n++, args=Cdr(args))
    845845  {
    846     BMat& b = Mat(args->Car());
    847     if((a.Rows()!=b.Rows())||(a.Columns()!=b.Columns())) { break; }
    848     for(i=0; i<a.Rows(); i++)
    849     {
    850       for(j=0; j<a.Columns(); j++)
     846    BSyntaxObject* arg = (BSyntaxObject*)args->Car();
     847    if(!arg) { continue; }
     848    BGrammar* g = arg->Grammar();
     849    if(g==GraMatrix())
     850    {
     851      BMat& b = Mat(arg);
     852      if((a.Rows()!=b.Rows())||(a.Columns()!=b.Columns())) { break; }
     853      for(i=0; i<a.Rows(); i++)
    851854      {
    852         a(i,j) = (*fun)(a(i,j), b(i,j));
     855        for(j=0; j<a.Columns(); j++)
     856        {
     857          a(i,j) = (*fun)(a(i,j), b(i,j));
     858        }
     859      }
     860    }
     861    else if(g==GraReal())
     862    {
     863      BDat& b = Dat(arg);
     864      for(i=0; i<a.Rows(); i++)
     865      {
     866        for(j=0; j<a.Columns(); j++)
     867        {
     868          a(i,j) = (*fun)(a(i,j), b);
     869        }
    853870      }
    854871    }
Note: See TracChangeset for help on using the changeset viewer.