Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14185

Subclassing numpy array for symmetric matrices

$
0
0

I want to create a numpy subclass specialized for symmetric matrices.I want it to be just like any numpy array with only 2 differences:

  1. It will have 2 fields for its eigendecomposition: U, D.
  2. On construction it will force symmetry.
    Like my_symmetric_arr() = 0.5*(m+m.T) where m is the regular matrix created by the default constructor.

How can that be done in the simplest way?


Viewing all articles
Browse latest Browse all 14185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>