i cant understand the following code
Matrix<开发者_如何学编程;float> trainData2 = trainData.GetRows(intVar >> 1, intVar, 1);
intVar is integer type... please help me to understand this code.
>> 1
means "shift right one" which is a low-level way of saying "divide unsigned by 2".
Maybe that's the clue you needed?
If the part you don't understand is intVar >> 1
, this is just shifting the value one bit at the right. In other words, it divides intVar by two.
Well >> 1
is right shift; in this case, it will (effectively) return halve the value of intVar
(except for some cases involving -ve numbers). I don't know what your trainData
is, but I'm guessing we're building a matrix of half of a table or something?
精彩评论