ScottKolo/suitesparse-matrix-collection-website

View on GitHub
app/views/collection_matrices/new.html.haml

Summary

Maintainability
Test Coverage
=provide(:title, "Submit Matrix")
=provide(:description, "Submit a new matrix to the SuiteSparse Matrix Collection")

:javascript
  var warnMessage = "";

  $(document).ready(function() {
      $('input:not(:button,:submit),textarea').change(function () {
          window.onbeforeunload = function () {
              if (warnMessage != null) return warnMessage;
          }
      });
      $('input:submit').click(function(e) {
          warnMessage = null;
      });
  });

%h1 Submit a New Matrix

%p
  Sparse matrices from real applications are critical to the development of
  sparse matrix algorithms.  Many sparse matrix algorithm developers
  use the matrices at this site to test their methods.  If you would like
  the next generation of sparse matrix methods to work well on matrices
  from your problem domain, then please submit matrices to the Collection by
  filling out the form below.

%p
  %strong
    Please include details about the matrix.
  In particular, include a paragraph or more about the problem the matrix
  represents.  Include any citations: journal articles, web pages,
  conference papers, books, etc that give more details.
  You cannot include this description in the
  form, so please include it an uploaded file, or email it to me at davis@tamu.edu.

%p
  Use any reasonable format; just tell me what you use.  I prefer either the
  Matrix Market format, or a MATLAB *.mat file.

%p
  Another simple method is the triplet format.  The triplet format is a simple
  ASCII file with 
  %em nz 
  lines; each line contains a row index, column index, and
  numerical value of one entry in the matrix (two values for a complex matrix,
  the real part followed by the imaginary part).  Duplicates are acceptable - these are
  summed in the output matrix.  The triplets can be in any order.  If the matrix
  dimension cannot be inferred from the row and column indices, please tell me
  what they are in another file or email message.
%p
  If you wish to include other data (right-hand sides, solutions,
  cost vector 
  %em c 
  for a linear programming problem, and so on),
  use a separate file for each matrix in your
  problem.  A dense vector of length 
  %em n 
  should appear as a file with 
  %em n 
  lines, and
  one entry per line (or use the Matrix Market format for dense matrices).
  Right-hand sides are particularly important for testing
  iterative solvers for sparse linear systems.

= form_for @new_matrix, method: "post", url: "/submit" do |f|
  %h2 Submitter Information
  %table{class: "table"}
    %tr
      %th{style: "width: 30%"}
        %label{for: "submitter-name"}
          Name
          .small
            Required
      %td
        = f.text_field :submitter_name, class: "form-control", maxlength: "100", required: true
    %tr
      %th
        %label{for: "submitter-email"}
          Email
          .small
            Required
      %td
        = f.email_field :submitter_email, class: "form-control", maxlength: "100", required: true
    %tr
      %th
        %label{for: "display-email"}
          Have this email displayed publically?
          .small
            We need your email to contact you, but you can choose to keep it private and unassociated with the matrix.
      %td
        = f.select :display_email, [['Display Publically', true], ['Hide', false]]

  %h2 Matrix Information
  %table{class: "table"}
    %tr
      %th{style: "width: 30%"}
        %label{for: "matrix-name"} Matrix Name
      %td
        = f.text_field :name, class: "form-control", placeholder: "A unique name for your matrix", maxlength: "100"
    %tr
      %th
        %label{for: "matrix-kind"} Kind/problem domain
      %td
        = f.select(:kind, @kinds)
    %tr
      %th
        %label{for: "matrix-notes"} Notes about the matrix
      %td
        = f.text_area :notes, class: "form-control", rows: "8", placeholder: "Bibliographic Information, Nature of Problem, Application, Numerical Issues, Matrix Creator, Why is it Interesting?", maxlength: "5000"
    %tr
      %th
        %label{for: "submitter-url"}
          How can we obtain the matrix?
          .small
            Required
      %td
        = f.text_area :submitter_url, class: "form-control", rows: "3", placeholder: "URL of matrix data file or other instructions for obtaining the matrix data", maxlength: "5000", required: true
    %tr
      %th
        %label{for: "submitter-confidentiality"}
          Do you grant permission to display this matrix publically?
          .small
            Sometimes submitters are concerned about confidentiality of the matrix data. If your matrix isn't yet ready for public release, let us know.
      %td
        = f.select :submitter_confidentiality, [['Display Publically', false], ['Not for Public Release', true]]
    %tr
      %td
        = recaptcha_tags
    %tr
      %td
        = submit_tag("Submit My Matrix")
%br
%br