Yuri,
You can use any/all facilities that Java has for matrices since Jess has
full (reflective) access to the Java/third-party matrix APIs - see:
http://math.nist.gov/javanumerics/jama
If you want to pattern match against elements in a matrix, you can use
multifields or ordered facts. For example:
(assert (row 1 col1 col2 col3))
(assert (row 2 col1 col2 col3))
(assert (row 3 col1 col2 col3))
(defrule find-matrix-with-all-matching-diagonal-values
(row 1 ?colValue ? ?)
(row 2 ? ?colValue ?)
(row 3 ? ? ?colValue)
=>
(printout t "Matrix has all diagonal values of " ?colValue)
)
(defrule find-identity-matrix
(row 1 1 0 0)
(row 2 0 1 0)
(row 3 0 0 1)
=>
(printout t "Matrix is the identity matrix")
)
Warning: the above is an over simplified example and could cause *huge*
numbers of partial matches if given the wrong/large input and doesn't
take into account reasoning over multiple matrix instances.
Of course, it gets more complicated if you need to write rules against
matrices of arbitrary/unknown dimensions.
Good luck!
alan
Yura wrote:
Hi All
Does anyone know how to implement matrixes in Jess?
Yuri
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------