sparse_matrix.h API modified to allow combined field selection based on parameters