David R. Leal Valmana wrote:
> Robin wrote:
>
> > > > Why, apart from saving two keystrokes?
> > > That is not true, because x could be very complicated expresion.
> > > Dot_Product(x(n1+n2+n3:n4+n5,n6),x(n1+n2+n3:n4+n5,n6))
> > > instead of
> > > Dot_Prod(x(n1+n2+n3:n4+n5,n6))
> >
> > Why not y = x(n1+n2+n3:n4+n5,n6)
> > ... DOT_PRODUCT (y, y)
>
> That is not so simple!
It's very simple. And if you don't like it, you can use my other
suggestion, which was to supplemnt the generic function
with a one-argument version of DOT_PRODUCT.
Or even SUM(y**2), which is even less typing.
> You need to create before the var. y(to spend memory) or to use a pointer
> association(to spend less memory), but in this case x has to be of type target
> or pointer and some times you don't need to impose a lot of conditions to var.
> x just to save some keystrokes. Moreover in case that x is an input or output
> var. of your sub. or functions, you impose to the people who want to use this
> subr. or function to define the input or output var. as pointer or target.
>
> In mathematical programming some times you need to use a lot of dot products
> and I think to make this operation you have to type a lot,
Then use the editor.
> in matlab it is
> very intuitive: x'*y, perhaps it is possible to make a kind of association
> between Dot_Product and .'*. in this case we would have: x.'*. y.
>
> Any way intrinsic functions are very useful and their names should be very
> clear but to understand what this function is going to do you just need
> Dot_Prod
Why? DOT_PRODUCT is just fine.
> this word is not confuse in the same way you don't need
> allocate_memory even this word is more explicit than just to use allocate.
>
> Thanks,
>
> David
> David R. Leal Valmana | Office: 10.1.02
> Tel: (34)-916.24.93.14 | Fax: (34)-916.24.98.49
> E-mail : [log in to unmask] | http://jupiter.uc3m.es/~david/
> Universidad Carlos III de Madrid | Dpto. de Estadistica y Econometria
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|