MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Compile with Boolean Arrays


Can anyone explain why this works:

MatrixMultiply =
 Compile[
  {{a, _Integer, 2}, {x, _Integer, 1}},
  Inner[Times, a, x, Plus],
  {{Inner[__], _Integer, 1}}
  ]

MatrixMultiply[{{2, 0}, {0, 1}}, {2, 1}]

But this doesn't:

LogicalMatrixMultiply =
 Compile[
  {{a, True | False, 2}, {x, True | False, 1}},
  Inner[And, a, x, Or],
  {{Inner[__], True | False, 1}}
  ]

LogicalMatrixMultiply[{{True, False}, {False, True}}, {True, False}]

I thought I used the correct syntax for Boolean arguments in Compile...


  • Prev by Date: Re: Mathematica and uniform distributions
  • Next by Date: Re: A new graphic user interface
  • Previous by thread: Re: remote kernel problem
  • Next by thread: Custom dialog during evaluation