octave-maintainers
[Top][All Lists]
Advanced

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

Re: Definition of operators in the parser


From: David Bateman
Subject: Re: Definition of operators in the parser
Date: Thu, 01 Jul 2010 21:47:56 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Jordi Gutiérrez Hermoso wrote:
In the text quoted below, I am rather satisfied with myself for being
able to trace through the code except for one bit. At what point in
the code does the parser translate "A\b" into xdiv and relatives?

look in src/OPERATORS/op-m-m.cc that defines the binary operator ldiv as

DEFBINOP (ldiv, matrix, matrix)
{
 CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&);
 MatrixType typ = v1.matrix_type ();

 Matrix ret = xleftdiv (v1.matrix_value (), v2.matrix_value (), typ);

 v1.matrix_type (typ);
 return ret;
}

you'll find the code that calls this on src/ov.cc in do_binary_op that is called in a number of different fashions elsewhere in ov.cc

D.



reply via email to

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