Jep, finally got it - that code works now. The Problem I had at the end was
that I didn't distinguish between type declaration of a function and a
value. -- the commented line for matrix 3 below shows what I did wrong.
I think we can close that topic for now - Thanks a lot for Your help
Henning
On Sat, 25 Dec 2010, gutti wrote:
this line works :
matrixfunction x y = liftMatrix2 (zipVectorWith(\a1 a2 -> if a2>=0 then a1 else
0)) x y
but when I use this line :
matrixfunction f x y = liftMatrix2 (zipVectorWith f) x y
how can / do I have to define f in a seperate line a way, that it
Hi,
Thanks for the help on the typing issue, that helped my understanding a lot.
Regarding the lift2 Matrix:
this line works :
matrixfunction x y = liftMatrix2 (zipVectorWith(\a1 a2 -> if a2>=0 then a1
else 0)) x y
but when I use this line :
matrixfunction f x y = liftMatrix2 (zipVector
On Wed, 22 Dec 2010, gutti wrote:
question 1. u see the two commented lines I tried to get ur original line
running, but didn't know how to specify f
What 'f' ? Do you mean
matrixfunction f x y = liftMatrix2 (zipVectorWith f) x y
?
## Code
import Numeric.LinearAlgebra
import G
Hi Henning,
You definitly caught me on that little Germanism :-)
About Your comments - a lot to learn and take in, but it really helps. -
Thanks a lot.
I just manged to get the Matrix masking running code looks like (code A see
below). Two quick questions:
question 1. u see the two commented
On Tue, 21 Dec 2010, gutti wrote:
One thing that still confuses me a litte:
polynom: double -> double ->double
polynom x y = y^2 + x^2 + 2*x*y
Type declaration for this polynom with two inputs
I guess you mean upper case "Double", otherwise it's a type variable and
the compiler will ask fo
Hi Henning,
Yes I just realised my mistake myself - I hand over the function instead of
the result. A really facinating concept by the way.
Thanks again for the Matrix notation - will give it a go right away now. And
the "manoever critics" on the code is really nice. - Helps me a lot to
embrac
thanks for the quick and comprehensive help. - I managed to implement
Hennings suggestion with mapVector and zipWithVector. -- However have a
type inference problem with zipVectorWith -- probably a stupid beginners
mistake. (have a look below). I want to look into the matrix thing as well,
but
Hi Henning, Hi Alberto,
thanks for the quick and comprehensive help. - I managed to implement
Hennings suggestion with mapVector and zipWithVector. -- However have a
type inference problem with zipVectorWith -- probably a stupid beginners
mistake. (have a look below). I want to look into the ma
On Tue, 21 Dec 2010, Alberto Ruiz wrote:
Vectorized boolean operations are not yet implemented but I hope to get them
ready soon, including a "find" function. In the meantime you can use
zipVectorWith, as mentioned by Henning.
I would not find it a great idea to support the MatLab style of h
Hi Phil,
On 12/20/2010 10:49 PM, gutti wrote:
Hi all,
In Matlab the following line of code:
V3 = V1.*(V2>0)
(V2>0) gives a Bool-Vector with ones (trues) and zero's where elements
of V2 are> 0; Then this Bool vector is used to multiply all elements in V1
to zero
where the condition V2>0 is no
On Mon, 20 Dec 2010, gutti wrote:
In Matlab the following line of code:
V3 = V1.*(V2>0)
What you certainly need is a zipWith function on matrices that lets you
write
Matrix.zipWith (\a1 a2 -> if a2>0 then a1 else 0) v1 v2
I can't see such a function in Matrix, but in Vector (zipVectorWi
Hi all,
In Matlab the following line of code:
V3 = V1.*(V2>0)
(V2>0) gives a Bool-Vector with ones (trues) and zero's where elements
of V2 are > 0; Then this Bool vector is used to multiply all elements in V1
to zero
where the condition V2>0 is not fulfilled.
How can I do that in Haskell ?
13 matches
Mail list logo