ATSLIB/prelude/matrixref

This package contains some common functions for creating/freeing and manipulating non-linear matrixref-values, which are just refereces to matrices without dimension information attached.


  • matrixref
  • matrixref_vt0ype_int_int_type
  • lemma_matrixref_param
  • matrixref_make_elt
  • matrixref_get_at
  • matrixref_get_at_int
  • matrixref_get_at_size
  • matrixref_set_at
  • matrixref_set_at_int
  • matrixref_set_at_size
  • matrixref_exch_at
  • matrixref_exch_at_int
  • matrixref_exch_at_size
  • fprint_matrixref
  • fprint_matrixref_sep
  • matrixref_tabulate
  • mtrxszref
  • mtrxszref_vt0ype_type
  • .ref
  • mtrxszref_get_ref
  • mtrxszref_get_nrow
  • mtrxszref_get_ncol
  • mtrxszref_get_refsize
  • mtrxszref_make_elt
  • mtrxszref_get_at
  • mtrxszref_get_at_int
  • mtrxszref_get_at_size
  • mtrxszref_set_at
  • mtrxszref_set_at_int
  • mtrxszref_set_at_size
  • mtrxszref_exch_at
  • mtrxszref_exch_at_int
  • mtrxszref_exch_at_size
  • fprint_mtrxszref
  • fprint_mtrxszref_sep
  • mtrxszref_tabulate
  • Overloaded Symbols
  • []
  • .nrow
  • .ncol
  • ptrcast
  • fprint

  • matrixref

    Synopsis

    stadef matrixref = matrixref_vt0ype_int_int_type

    Description

    Given a type T and two integers M and N, the type matrixref(T, M, N) is for persistent matrices of dimension M by N in which each element is of the type T.

    matrixref_vt0ype_int_int_type

    Synopsis

    abstype
    matrixref_vt0ype_int_int_type
      (a:vt@ype(*inv*), nrow: int, ncol:int) = ptr

    lemma_matrixref_param

    Synopsis

    praxi
    lemma_matrixref_param
      {a:vt0p}{m,n:int}
      (M: matrixref (a, m, n)): [m >= 0; n >= 0] void

    matrixref_make_elt

    Synopsis

    fun{
    a:t0p
    } matrixref_make_elt
      {m,n:int}
      (m: size_t m, n: size_t n, x0: a):<!wrt> matrixref (a, m, n)

    matrixref_get_at

    Synopsis

    overload matrixref_get_at with matrixref_get_at_int of 0
    overload matrixref_get_at with matrixref_get_at_size of 0

    matrixref_get_at_int

    Synopsis

    fun{a:t0p}
    matrixref_get_at_int
      {m,n:int}
    (
      M: matrixref (a, m, n), i: natLt(m), n: int(n), j: natLt(n)
    ) :<!ref> (a) // end of [matrixref_get_at_int]

    matrixref_get_at_size

    Synopsis

    fun{a:t0p}
    matrixref_get_at_size
      {m,n:int}
    (
      M: matrixref (a, m, n), i: sizeLt(m), n: size_t(n), j: sizeLt(n)
    ) :<!ref> (a) // end of [matrixref_get_at_size]

    matrixref_set_at

    Synopsis

    overload matrixref_set_at with matrixref_set_at_int of 0
    overload matrixref_set_at with matrixref_set_at_size of 0

    matrixref_set_at_int

    Synopsis

    fun{a:t0p}
    matrixref_set_at_int
      {m,n:int}
    (
      M: matrixref (a, m, n), i: natLt (m), n: int n, j: natLt (n), x: a
    ) :<!refwrt> void // end of [matrixref_set_at_int]

    matrixref_set_at_size

    Synopsis

    fun{a:t0p}
    matrixref_set_at_size
      {m,n:int}
    (
      M: matrixref (a, m, n), i: sizeLt (m), n: size_t n, j: sizeLt (n), x: a
    ) :<!refwrt> void // end of [matrixref_set_at_size]

    matrixref_exch_at

    Synopsis

    overload matrixref_exch_at with matrixref_exch_at_int of 0
    overload matrixref_exch_at with matrixref_exch_at_size of 0

    matrixref_exch_at_int

    Synopsis

    fun{a:vt0p}
    matrixref_exch_at_int
      {m,n:int}
    (
      M: matrixref (a, m, n)
    , i: natLt (m), n: int n, j: natLt (n), x: &a >> _
    ) :<!refwrt> void // end of [matrixref_exch_at_int]

    matrixref_exch_at_size

    Synopsis

    fun{a:vt0p}
    matrixref_exch_at_size
      {m,n:int}
    (
      M: matrixref (a, m, n)
    , i: sizeLt (m), n: size_t n, j: sizeLt (n), x: &a >> _
    ) :<!refwrt> void // end of [matrixref_exch_at_size]

    fprint_matrixref

    Synopsis

    fun{a:vt0p}
    fprint_matrixref{m,n:int}
    (
      out: FILEref
    , M: matrixref (a, m, n), m: size_t m, n: size_t n
    ) : void // end of [fprint_matrixref]

    fprint_matrixref_sep

    Synopsis

    fun{a:vt0p}
    fprint_matrixref_sep{m,n:int}
    (
      out: FILEref
    , M: matrixref (a, m, n), m: size_t (m), n: size_t (n)
    , sep1: NSH(string), sep2: NSH(string)
    ) : void // end of [fprint_matrixref_sep]

    matrixref_tabulate

    Synopsis

    fun{a:vt0p}
    matrixref_tabulate
      {m,n:int} (nrow: size_t m, ncol: size_t n): matrixref (a, m, n)

    mtrxszref

    Synopsis

    stadef mtrxszref = mtrxszref_vt0ype_type

    mtrxszref_vt0ype_type

    Synopsis

    abstype // in-variant
    mtrxszref_vt0ype_type(a:vt@ype) = ptr

    .ref

    Synopsis

    overload .ref with mtrxszref_get_ref

    mtrxszref_get_ref

    Synopsis

    fun{}
    mtrxszref_get_ref{a:vt0p} (M: mtrxszref (a)):<> Ptr1

    mtrxszref_get_nrow

    Synopsis

    fun{}
    mtrxszref_get_nrow{a:vt0p} (M: mtrxszref (a)):<> size_t

    mtrxszref_get_ncol

    Synopsis

    fun{}
    mtrxszref_get_ncol{a:vt0p} (M: mtrxszref (a)):<> size_t

    mtrxszref_get_refsize

    Synopsis

    fun{}
    mtrxszref_get_refsize{a:vt0p}
    (
      M: mtrxszref (a)
    , nrol: &size_t? >> size_t m, ncol: &size_t? >> size_t (n)
    ) :<!wrt> #[m,n:nat] matrixref (a, m, n) // endfun

    mtrxszref_make_elt

    Synopsis

    fun{a:t0p}
    mtrxszref_make_elt
      (nrow: size_t, ncol: size_t, init: a):<!wrt> mtrxszref (a)

    mtrxszref_get_at

    Synopsis

    overload mtrxszref_get_at with mtrxszref_get_at_int of 0
    overload mtrxszref_get_at with mtrxszref_get_at_size of 0

    mtrxszref_get_at_int

    Synopsis

    fun{a:t0p}
    mtrxszref_get_at_int
      (M: mtrxszref(a), i: int, j: int):<!exnref> (a)

    mtrxszref_get_at_size

    Synopsis

    fun{a:t0p}
    mtrxszref_get_at_size
      (M: mtrxszref(a), i: size_t, j: size_t):<!exnref> (a)

    mtrxszref_set_at

    Synopsis

    overload mtrxszref_set_at with mtrxszref_set_at_int of 0
    overload mtrxszref_set_at with mtrxszref_set_at_size of 0

    mtrxszref_set_at_int

    Synopsis

    fun{a:t0p}
    mtrxszref_set_at_int
      (M: mtrxszref(a), i: int, j: int, x: a):<!exnrefwrt> void

    mtrxszref_set_at_size

    Synopsis

    fun{a:t0p}
    mtrxszref_set_at_size
      (M: mtrxszref(a), i: size_t, j: size_t, x: a):<!exnrefwrt> void

    mtrxszref_exch_at

    Synopsis

    Synopsis for [mtrxszref_exch_at] is unavailable.

    mtrxszref_exch_at_int

    Synopsis

    Synopsis for [mtrxszref_exch_at_int] is unavailable.

    mtrxszref_exch_at_size

    Synopsis

    Synopsis for [mtrxszref_exch_at_size] is unavailable.

    fprint_mtrxszref

    Synopsis

    fun{a:vt0p}
    fprint_mtrxszref
    (
      out: FILEref, M: mtrxszref(a)
    ) : void // end of [fprint_mtrxszref]

    fprint_mtrxszref_sep

    Synopsis

    fun{a:vt0p}
    fprint_mtrxszref_sep
    (
      out: FILEref
    , M: mtrxszref(a), sep1: NSH(string), sep2: NSH(string)
    ) : void // end of [fprint_mtrxszref_sep]

    mtrxszref_tabulate

    Synopsis

    fun{a:vt0p}
    mtrxszref_tabulate (nrow: size_t, ncol: size_t): mtrxszref (a)

    Overloaded Symbols


    []

    Synopsis

    overload [] with matrixref_get_at_int of 0
    overload [] with matrixref_get_at_size of 0
    overload [] with matrixref_set_at_int of 0
    overload [] with matrixref_set_at_size of 0
    overload [] with mtrxszref_get_at_int of 0
    overload [] with mtrxszref_get_at_size of 0
    overload [] with mtrxszref_set_at_int of 0
    overload [] with mtrxszref_set_at_size of 0

    .nrow

    Synopsis

    overload .nrow with mtrxszref_get_nrow

    .ncol

    Synopsis

    overload .ncol with mtrxszref_get_ncol

    ptrcast

    Synopsis

    overload ptrcast with matrixref2ptr

    fprint

    Synopsis

    overload fprint with fprint_matrixref
    overload fprint with fprint_matrixref_sep
    overload fprint with fprint_mtrxszref
    overload fprint with fprint_mtrxszref_sep

    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo