Lines Matching refs:weight
39 /* collation element weight allocation -------------------------------------- */
44 getWeightTrail(uint32_t weight, int32_t length) {
45 return (uint32_t)(weight>>(8*(4-length)))&0xff;
49 setWeightTrail(uint32_t weight, int32_t length, uint32_t trail) {
51 return (uint32_t)((weight&(0xffffff00<<length))|(trail<<length));
55 getWeightByte(uint32_t weight, int32_t idx) {
56 return getWeightTrail(weight, idx); /* same calculation */
60 setWeightByte(uint32_t weight, int32_t idx, uint32_t byte) {
80 return (uint32_t)((weight&mask)|(byte<<idx));
84 truncateWeight(uint32_t weight, int32_t length) {
85 return (uint32_t)(weight&(0xffffffff<<(8*(4-length))));
89 incWeightTrail(uint32_t weight, int32_t length) {
90 return (uint32_t)(weight+(1UL<<(8*(4-length))));
94 decWeightTrail(uint32_t weight, int32_t length) {
95 return (uint32_t)(weight-(1UL<<(8*(4-length))));
154 CollationWeights::incWeight(uint32_t weight, int32_t length) const {
156 uint32_t byte=getWeightByte(weight, length);
158 return setWeightByte(weight, length, byte+1);
161 weight=setWeightByte(weight, length, minBytes[length]);
169 CollationWeights::incWeightByOffset(uint32_t weight, int32_t length, int32_t offset) const {
171 offset += getWeightByte(weight, length);
173 return setWeightByte(weight, length, offset);
177 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length));
194 /* for uprv_sortArray: sort ranges in weight order */
263 uint32_t weight=lowerLimit;
265 uint32_t trail=getWeightTrail(weight, length);
267 lower[length].start=incWeightTrail(weight, length);
268 lower[length].end=setWeightTrail(weight, length, maxBytes[length]);
272 weight=truncateWeight(weight, length-1);
274 if(weight<0xff000000) {
275 middle.start=incWeightTrail(weight, middleLength);
282 weight=upperLimit;
284 uint32_t trail=getWeightTrail(weight, length);
286 upper[length].start=setWeightTrail(weight, length, minBytes[length]);
287 upper[length].end=decWeightTrail(weight, length);
291 weight=truncateWeight(weight, length-1);
293 middle.end=decWeightTrail(weight, middleLength);
409 /* sort the ranges by weight values */
552 /* get the next weight */
554 uint32_t weight = range.start;
559 /* increment the weight for the next value */
560 range.start = incWeight(weight, range.length);
564 return weight;