Opened 8 months ago

Closed 8 months ago

#974 closed enhancement (fixed)

document which Matrix functions that destroy references/views to Matrix

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.20
Component: documentation Version: trunk
Keywords: Cc:

Description

For example:

Matrix X(3,3);
double& a = X(0,0);
X.resize(4,4);

It's obvious that 'a' is hanging, but for other operations like +=, *=, ::transpose() etc it's not obvious and needs to documented.

Change History (2)

comment:1 Changed 8 months ago by Peter

References, iterators and views are invalidated when gsl_matrix* m_ is reallocated or when blas_result_ is used and subsequently swapped with m_. That means (afaicu) that the following functionality imply invalidated references/iterators/views:

  • ::resize (unless size is unchanged)
  • ::transpose (unless square matrix)
  • operator=(const Matrix&) (unless dimensions on lhs and rhs are the same)
  • operator=(Matrix&&) (regardless of dimensions)
  • operator=(const MatrixExpression?&) (regardless of dimensions)
  • operator=(MatrixExpression?&&) (regardless of dimensions)
  • operator*=(const Matrix&) (and documented)
  • inverse_svd(2)
  • nan(2)

comment:2 Changed 8 months ago by Peter

Resolution: fixed
Status: newclosed

In 4118:

document operations that invalidate references, views, iterators, etc. closes #974

Note: See TracTickets for help on using tickets.