On Thu, Jan 15, 2026 at 03:19:39PM +0100, 'Ralf Hemmecke' via FriCAS - computer 
algebra system wrote:
> I am sure you agree that this is incorrect.
> I actually used Fraction(Integer) instead of Integer where printing the
> array a results in
> 
>    >> System error:
>    The value
>   0
> is not of type
>   CONS
> 
> Patch is attached.

Thanks.  However, together with the patch it would be good to
commit a test (to bugs2026.input).  Say something like

a := array2([[1, 2], [3, 4], [5, 6]])
testEquals("nrows(a)", "3")
testEquals("ncols(a)", "2")

Could you commit both the patch + a test?

> Ralf
> 
> ===========================================================
> 
> %%% (1) -> arr2 ==> array2 $ IndexedTwoDimensionalArray(Integer,0,0)
>                                        Type: Void
> %%% (2) -> a := arr2([[11,12,13],[21,22,23],[31,32,33],[41,42,43]]);
>                     Type: IndexedTwoDimensionalArray(Integer,0,0)
> %%% (3) -> [minRowIndex a, maxRowIndex a, minColIndex a, maxColIndex a]
> 
>    (3)  [0, 2, 0, 3]
>                     Type: List(NonNegativeInteger)
> %%% (4) -> a
> 
>         +11  12  13  0+
>         |             |
>    (4)  |21  22  23  0|
>         |             |
>         +31  32  33  0+
>                     Type: IndexedTwoDimensionalArray(Integer,0,0)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/fricas-devel/660e60d8-48ff-4feb-9213-717285821d6b%40hemmecke.org.

> From 6d6515e7da8ef21502f1e85d743f2634bf407e7c Mon Sep 17 00:00:00 2001
> From: Ralf Hemmecke <[email protected]>
> Date: Thu, 15 Jan 2026 15:17:18 +0100
> Subject: bugfix: number of rows and columns were wrongly initialized
> 
> ---
>  src/algebra/array2.spad | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/algebra/array2.spad b/src/algebra/array2.spad
> index 3d7f499b..38bcb342 100644
> --- a/src/algebra/array2.spad
> +++ b/src/algebra/array2.spad
> @@ -932,7 +932,7 @@ TwoDimensionalArrayCategory(R, Row, Col) : Category == 
> Definition where
>          empty?(ll) => qnew(0, 0)
>          m := #ll::NNI
>          n := #first(ll)::NNI
> -        a2 := qnew(n, m)
> +        a2 := qnew(m, n)
>          for i in minRowIndex(a2)..maxRowIndex(a2) for l in ll repeat
>              if #l ~= n then
>                  error "array2: rows of different lengths"
> -- 
> 2.43.0
> 


-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/aWlV7WMlkaBEESBE%40fricas.org.

Reply via email to