示例#1
0
            public Tile(Window v, Rectangle bnds, tensor t = null, formula f = null)
            {
                def = f;
                sub = t;
                foc = false;

                pan          = new Panel();
                pan.Location = bnds.Location;
                pan.Name     = "pan";
                pan.Size     = bnds.Size;
                pan.TabIndex = 2;
                pan.Paint   += ppaint;
                pan.Click   += pclick;
                v.Controls.Add(pan);

                text              = new TextBox();
                text.Location     = bnds.Location;
                text.Name         = "text";
                text.Size         = bnds.Size;
                text.TabIndex     = 1;
                text.TextChanged += tchange;
                //text.Visible = false;
                text.Click += pclick;
                v.Controls.Add(pan);
            }
示例#2
0
 public tensor dot(tensor b)
 {
     if (rows == b.rows && cols == b.cols)
     {
         var bits = new List <List <double> >();
         for (int i = 0; i < rows; i++)
         {
             for (int j = 0; j < cols; j++)
             {
                 bits[i][j] = parts[i][j] + b.parts[i][j];
             }
         }
         return(new tensor(bits));
     }
     else
     {
         throw new Exception("Error: Tensors have different number of dimensions.");
     }
 }