【发布时间】:2015-02-25 22:23:37
【问题描述】:
这是我的课:
public class walidacja
{
public char znak { get; set; }
public double wyj_neuron_1 { get; set; }
public double wyj_neuron_2 { get; set; }
public double wyj_neuron_3 { get; set; }
public double wyj_neuron_1_norm { get; set; }
public double wyj_neuron_2_norm { get; set; }
public double wyj_neuron_3_norm { get; set; }
public bool rozpoznaj { get; set; }
public walidacja(char lit, double a, double b, double c, bool test)
{
this.znak = lit;
this.wyj_neuron_1 = a;
this.wyj_neuron_2 = b;
this.wyj_neuron_3 = c;
this.wyj_neuron_1_norm = a / (a + b + c);
this.wyj_neuron_2_norm = b / (a + b + c);
this.wyj_neuron_3_norm = c / (a + b + c);
this.rozpoznaj = test;
}
}
那我声明
valid = new walidacja[counter];
我用数据填充数组。 Znak 填充了相等数量的 3 个字母(因此如果 counter = 15,则 znak 字段中将有 5 个 a、5 个 b、5 个 c)。
为什么不按 char znak 对数组进行排序?
valid.OrderBy(a => a.znak);
【问题讨论】:
-
Sort/OrderBy 不作用于对象 - 它返回一个新的
validordered