implement compatibility with sparse matrices

Status Name Job ID Coverage
  Static Checks
canceled check_no_asserts #1373835

 
  Build Docker
canceled build_docker_from_cache #1373836

 
  Test
canceled test_mpi #1373838

canceled test_serial #1373837

 
  Demo Runs
canceled run_bernoulli #1373846

canceled run_curve_fitting #1373847

canceled run_getting_density #1373845

canceled run_getting_started_1 #1373841

canceled run_getting_started_2 #1373842

canceled run_getting_started_3 #1373843

canceled run_getting_started_mf #1373844

canceled run_ipynb0 #1373839

canceled run_ipynb1 #1373840

canceled run_meanfield #1373849

canceled run_nonlinearity_guide #1373850

canceled run_visual_vi #1373848